public final class SplineInterpolator extends Object implements Interpolator
For more information on how splines are used to interpolate, refer to the SMIL specification at http://w3c.org.
This class provides one simple built-in facility for non-linear interpolation. Applications are free to define their own Interpolator implementation and use that instead when particular non-linear effects are desired.
Constructor and Description |
---|
SplineInterpolator(float x1,
float y1,
float x2,
float y2)
Creates a new instance of SplineInterpolator with the control points
defined by (x1, y1) and (x2, y2).
|
Modifier and Type | Method and Description |
---|---|
float |
interpolate(float lengthFraction)
Given a fraction of time along the spline (which we can interpret
as the length along a spline), return the interpolated value of the
spline.
|
public SplineInterpolator(float x1, float y1, float x2, float y2)
IllegalArgumentException
- This exception is thrown when values
beyond the allowed [0,1] range are passed inpublic float interpolate(float lengthFraction)
interpolate
in interface Interpolator
lengthFraction
- Fraction of time in a given time interval.