public final class LinearInterpolator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected double |
_start |
protected double |
_step |
protected double[] |
_values |
Constructor and Description |
---|
LinearInterpolator(double[] values,
double start,
double step)
Creates a new instance of Interpolator.
|
Modifier and Type | Method and Description |
---|---|
double |
calcValueAt(double point)
Calculate the interpolated value at the specified point in the domain.
|
protected final double[] _values
protected final double _start
protected final double _step
public LinearInterpolator(double[] values, double start, double step)
values
- is the array of values at fixed intervals.start
- is the start of the domain of points and corresponds to the first array elementstep
- is the step in the domain for each successive element in the arraypublic double calcValueAt(double point) throws java.lang.ArrayIndexOutOfBoundsException
start
to start + step * values.length
.point
- The point in the domain for which we should interpolate the value.java.lang.ArrayIndexOutOfBoundsException
- if the point does not fall int the accepted domain