com.graphbuilder.math.VarNode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of curvesapi Show documentation
Show all versions of curvesapi Show documentation
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.
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