com.graphbuilder.math.SubNode 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, represented by the symbol "-".
*/
public class SubNode extends OpNode {
public SubNode(Expression leftChild, Expression rightChild) {
super(leftChild, rightChild);
}
/**
Subtracts the evaluation of the right side from the evaluation of the left side and returns the result.
*/
public double eval(VarMap v, FuncMap f) {
double a = leftChild.eval(v, f);
double b = rightChild.eval(v, f);
return a - b;
}
public String getSymbol() {
return "-";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy