public class LagrangeInterpolator extends Function
Burden, R.L., and J.D Faires. "Numercial Analysis", Sixth Ed., Brooks/Cole Publishing, 1997, pp 107-111.Briefly, the interpolator derives an (n-1)th order polynomial using the n known data points (xi, yi) where i=1..n with the formula:
P(x) = SUM(i=1..n) { yiLi(x) }where:
Li(x) = PRODUCT(j=1..n,j!=i) { (x-xj) / (xi - xj) }
Constructor and Description |
---|
LagrangeInterpolator(double[] x,
double[] y)
Creates a new Lagrangian interpolator based on the specified
data.
|
Modifier and Type | Method and Description |
---|---|
double |
evaluate(double[] variables)
Evalutes a function value with the specified inputs.
|
getEncoding, useEncoding
public LagrangeInterpolator(double[] x, double[] y)
x
- the x data values.y
- the y function values corresponding to
x1..xn.public double evaluate(double[] variables)
Function