public final class NewtonPolynomial extends Object
| Constructor and Description |
|---|
NewtonPolynomial(double[] point,
double[] value)
Create a new Newton polynomial with the given points and function values.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
double |
evaluateAt(double x)
Evaluate this Newton polynomial at the given point.
|
int |
hashCode() |
CubicFunction |
toCubic()
Convert this Newton polynomial to the standard form of a cubic function, f(x)
= ax3 + bx2 + cx + d.
|
QuadraticFunction |
toQuadratic()
Convert this Newton polynomial to the standard form of a quadratic function, f(x)
= ax2 + bx + c.
|
public NewtonPolynomial(double[] point,
double[] value)
point - the array of sample points.value - the array of sample function values at each corresponding point.public double evaluateAt(double x)
x - the point at which to evaluate this Newton polynomial.public QuadraticFunction toQuadratic() throws IllegalStateException
IllegalStateException - if the degree of this Newton polynomial is lower than 2.public CubicFunction toCubic() throws IllegalStateException
IllegalStateException - if the degree of this Newton polynomial is lower than 3.