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

com.graphbuilder.math.SubNode 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, 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