All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.graphbuilder.math.VarNode Maven / Gradle / Ivy

Go to download

Implementation of various mathematical curves that define themselves over a set of control points. The API is written in Java. The curves supported are: Bezier, B-Spline, Cardinal Spline, Catmull-Rom Spline, Lagrange, Natural Cubic Spline, and NURBS.

There is a newer version: 1.08
Show newest version
package com.graphbuilder.math;

/**
A node of an expression tree that represents a variable.  A VarNode cannot have any children.
*/
public class VarNode extends TermNode {

	public VarNode(String name, boolean negate) {
		super(name, negate);
	}

	/**
	Returns the value associated with the variable name in the VarMap.
	*/
	public double eval(VarMap v, FuncMap f) {
		double val = v.getValue(name);

		if (negate) val = -val;

		return val;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy