public abstract class Spline extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Spline.LinearSpline |
static class |
Spline.MonotoneCubicSpline |
Constructor and Description |
---|
Spline() |
Modifier and Type | Method and Description |
---|---|
static Spline |
createLinearSpline(float[] x,
float[] y)
Creates a linear spline from a given set of control points.
|
static Spline |
createMonotoneCubicSpline(float[] x,
float[] y)
Creates a monotone cubic spline from a given set of control points.
|
static Spline |
createSpline(float[] x,
float[] y)
Creates an appropriate spline based on the properties of the control points.
|
abstract float |
interpolate(float x)
Interpolates the value of Y = f(X) for given X.
|
public abstract float interpolate(float x)
x
- The X value.public static Spline createSpline(float[] x, float[] y)
public static Spline createMonotoneCubicSpline(float[] x, float[] y)
x
- The X component of the control points, strictly increasing.y
- The Y component of the control points, monotonic.IllegalArgumentException
- if the X or Y arrays are null, have
different lengths or have fewer than 2 values.IllegalArgumentException
- if the control points are not monotonic.public static Spline createLinearSpline(float[] x, float[] y)
x
- The X component of the control points, strictly increasing.y
- The Y component of the control points.IllegalArgumentException
- if the X or Y arrays are null, have
different lengths or have fewer than 2 values.IllegalArgumentException
- if the X components of the control points are not strictly
increasing.