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

com.graphbuilder.math.func.FloorFunction 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.func;

/**
The floor function.

@see java.lang.Math#floor(double)
*/
public class FloorFunction implements Function {

	public FloorFunction() {}

	/**
	Returns the floor of the value at index location 0.
	*/
	public double of(double[] d, int numParam) {
		return java.lang.Math.floor(d[0]);
	}

	/**
	Returns true only for 1 parameter, false otherwise.
	*/
	public boolean acceptNumParam(int numParam) {
		return numParam == 1;
	}

	public String toString() {
		return "floor(x)";
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy