math.approximations
Class CubicSpline
java.lang.Object
math.approximations.CubicSpline
- All Implemented Interfaces:
- Function
public class CubicSpline
- extends java.lang.Object
- implements Function
Constructor Summary |
CubicSpline(double[] xdata,
double[] ydata)
Constructs a CubicSpline interpolating function from the given data. |
CubicSpline(Points p)
Input the Points so that they are sorted by x in increasing
or decreasing value; |
Method Summary |
double |
evaluate(double x)
Computes the interpolated y value for a given x value. |
void |
update(double[] xdata,
double[] ydata)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CubicSpline
public CubicSpline(Points p)
- Input the Points so that they are sorted by x in increasing
or decreasing value;
- Parameters:
p
-
CubicSpline
public CubicSpline(double[] xdata,
double[] ydata)
- Constructs a CubicSpline interpolating function from the given data.
X data array must be sorted in increasing or decreasing value. The checkSorting method in the
Util package can be used to check the sorting of an array.
- Parameters:
xdata
- double[]ydata
- double[]
update
public void update(double[] xdata,
double[] ydata)
evaluate
public double evaluate(double x)
- Computes the interpolated y value for a given x value.
- Specified by:
evaluate
in interface Function
- Parameters:
x
-
- Returns:
- interpolated y value.