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

com.graphbuilder.math.func.PowFunction 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 power function.

@see java.lang.Math#pow(double,double)
*/
public class PowFunction implements Function {

	public PowFunction() {}

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

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

	public String toString() {
		return "pow(x, y)";
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy