public class Interpolation extends Object
Constructor and Description |
---|
Interpolation(double[] xValues,
double[][] yValues)
Creates a new instance of Interpolation.
|
Modifier and Type | Method and Description |
---|---|
double[] |
getXValues()
Returns the x-values of the data points (x, y).
|
double[][] |
getYValues()
Returns the array of y-values of the data points (x, y).
|
double[] |
piecewiseLinear(double x)
piecewise linear continuous function interpolating between the x-y values.
|
double[] |
polynomial(double x)
Returns the value at x of the polynomial interpolating through
the given data points, as given by Lagrange's classical formula.
|
public Interpolation(double[] xValues, double[][] yValues)
xValues
- the x-values of the data points (x, y)yValues
- an array of the y-values of the data points (x, y)public double[] getXValues()
public double[][] getYValues()
public double[] piecewiseLinear(double x)
x
- a data pointpublic double[] polynomial(double x)
x
- a data pointIllegalArgumentException
- if there exist two identical x-values