|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.diva.interp.AbstractInterpolator
uk.ac.starlink.diva.interp.LinearInterp
uk.ac.starlink.diva.interp.AkimaSplineInterp
public class AkimaSplineInterp
Interpolate a series of points using a scheme based Akima's splines.
The effect is supposed to construct reasonable analytic curves through discrete data points (i.e. like those a human would produce).
Field Summary |
---|
Fields inherited from class uk.ac.starlink.diva.interp.AbstractInterpolator |
---|
c, decr, x, y |
Constructor Summary | |
---|---|
AkimaSplineInterp()
Create an instance with no coordinates. |
|
AkimaSplineInterp(double[] x,
double[] y)
Create an instance with the given coordinates. |
Method Summary | |
---|---|
double |
interpolate(double xp)
Return the interpolated value corresponding to some arbitrary X coordinate. |
static void |
main(String[] args)
Simple test entry point |
void |
setCoords(double[] x,
double[] y,
boolean check)
Set or reset the coordinates used by this interpolator. |
Methods inherited from class uk.ac.starlink.diva.interp.LinearInterp |
---|
guessStep |
Methods inherited from class uk.ac.starlink.diva.interp.AbstractInterpolator |
---|
appendValue, binarySearch, evalYData, evalYDataArray, getCount, getXCoord, getXCoords, getYCoord, getYCoords, isFull, isIncreasing, stepGuess |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AkimaSplineInterp()
setCoords
must be made before any other methods.
public AkimaSplineInterp(double[] x, double[] y)
interpolate
method. The X
coordinates should be monotonic, either increasing or
decreasing. Same value X coordinates are not allowed.
x
- the X coordinates.y
- the Y coordinates.Method Detail |
---|
public void setCoords(double[] x, double[] y, boolean check)
Interpolator
setCoords
in interface Interpolator
setCoords
in class AbstractInterpolator
x
- the X coordinates.y
- the Y coordinates.check
- whether to check the monotonic direction (compares
0 and 1 values of x). Use this when you need to
preserve the direction temporarily even though the
order may currently be switched, but take care to
reorder before interpolating.public double interpolate(double xp)
Interpolator
interpolate
in interface Interpolator
interpolate
in class LinearInterp
xp
- the X coordinate at which an interpolated Y
coordinate is required.
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |