| Constructor and Description |
|---|
PolynomialFunction(double[] coeffs)
Create a new
PolynomialFunction.
|
| Modifier and Type | Method and Description |
|---|---|
static PolynomialFunction |
createFit(double[] xs, double[] ys)
Creates a
PolynomialFunction that uses the coordinates provided.
|
static PolynomialFunction |
createFit(double[] xs, double[] ys, double[] yDerivatives)
Creates a
PolynomialFunction that uses the coordinates provided.
|
static PolynomialFunction |
createFit(double x1, double y1, double x2, double y2)
Creates a linear
PolynomialFunction that passes through the two points provided.
|
double |
evaluate(double x)
Evaluates f(x).
|
double[] |
evaluateInverse(double y)
Solve this polynomial function by recursive exploring all the derivatives and strategically applying Newton's Method.
|
PolynomialFunction |
getDerivative()
|
double[] |
solve()
Calls
evaluateInverse(0)
|
String |
toString()
|
public PolynomialFunction(double[] coeffs)
PolynomialFunction.
coeffs - the coefficients of this polynomial. The first coefficient corresponds to the highest power of x. So if coeffs is [2, 3, 4] then this function will evaluate as (2*t*t+3*t+4).
public static PolynomialFunctioncreateFit(double x1, double y1, double x2, double y2)
PolynomialFunction that passes through the two points provided.
x1 - the x-coordinate of the first point.
y1 - the y-coordinate of the first point.
x2 - the x-coordinate of the second point.
y2 - the y-coordinate of the second point.
PolynomialFunction that passes through the points provided.
public static PolynomialFunctioncreateFit(double[] xs, double[] ys)
PolynomialFunction that uses the coordinates provided.
xs - an array of x-coordinates.
ys - an array of y-coordinates. Each element in this array corresponds to an element of the x coordinates.
public static PolynomialFunctioncreateFit(double[] xs, double[] ys, double[] yDerivatives)
PolynomialFunction that uses the coordinates provided.
xs - an array of x-coordinates.
ys - an array of y-coordinates. Each element in this array corresponds to an element of the x coordinates.
yDerivatives - an array of dy/dx values. Each element in this array corresponds to an element of the x coordinates.
public double evaluate(double x)
Function
public StringtoString()
public PolynomialFunctiongetDerivative()
public double[] evaluateInverse(double y)
evaluateInverse in interface
Function
y - a possible output of this function.
public double[] solve()
evaluateInverse(0)
evaluateInverse(0)