|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mines.jtk.util.CubicInterpolator
public class CubicInterpolator
Piecewise cubic interpolation of a function y(x) (or its derivatives).
Piecewise cubic interpolators differ in the method they use to compute slopes y'(x) at specified x (knots). The classic cubic spline computes the slopes to obtain a continuous second derivative at the knots. These splines often yield unacceptable wiggliness (overshoot) between the knots. A linear spline yields no overshoot, but has discontinuous first (and higher) derivatives. A monotonic spline has continuous first derivatives and yields monotonic interpolation (with no overshoot) where function values at the knots are monotonically increasing or decreasing.
For x outside the range of values specified when an interpolator was constructed, the interpolator extrapolates using the cubic polynomial corresponding to the knot nearest to x.
| Nested Class Summary | |
|---|---|
static class |
CubicInterpolator.Method
The method used for piecewise cubic interpolation. |
| Constructor Summary | |
|---|---|
CubicInterpolator(CubicInterpolator.Method method,
int n,
float[] x,
float[] y)
Constructs an interpolator. |
|
| Method Summary | |
|---|---|
float |
interpolate(float x)
Interpolates a function value y(x). |
void |
interpolate(int n,
float[] x,
float[] y)
Interpolates an array of function values y(x). |
float |
interpolate1(float x)
Interpolates the first derivative y'(x). |
void |
interpolate1(int n,
float[] x,
float[] y)
Interpolates an array of first derivatives y'(x). |
float |
interpolate2(float x)
Interpolates the second derivative y''(x). |
void |
interpolate2(int n,
float[] x,
float[] y)
Interpolates an array of second derivatives y''(x). |
float |
interpolate3(float x)
Interpolates the third derivative y'''(x). |
void |
interpolate3(int n,
float[] x,
float[] y)
Interpolates an array of third derivatives y'''(x). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CubicInterpolator(CubicInterpolator.Method method,
int n,
float[] x,
float[] y)
method - interpolation method: LINEAR, MONOTONIC, or SPLINE.n - number of x and y(x) values specified.x - array[n] of values at which y(x) are specified.
These values must be monotonically increasing or decreasing,
with no equal values. (In other words, the array must be
monotonic-definite.)y - array[n] of function values y(x).| Method Detail |
|---|
public final float interpolate(float x)
x - value at which to interpolate.
public final float interpolate1(float x)
x - value at which to interpolate.
public final float interpolate2(float x)
x - value at which to interpolate.
public final float interpolate3(float x)
x - value at which to interpolate.
public void interpolate(int n,
float[] x,
float[] y)
n - number of values to interpolate.x - array of values at which to interpolate.y - array of interpolated function values.
public void interpolate1(int n,
float[] x,
float[] y)
n - number of derivatives to interpolate.x - array of values at which to interpolate.y - array of interpolated first derivatives y'(x).
public void interpolate2(int n,
float[] x,
float[] y)
n - number of derivatives to interpolate.x - array of values at which to interpolate.y - array of interpolated second derivatives y''(x).
public void interpolate3(int n,
float[] x,
float[] y)
n - number of derivatives to interpolate.x - array of values at which to interpolate.y - array of interpolated third derivatives y'''(x).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||