public class CatmullRomInterpolator extends Object implements Interpolator<CatmullRomInterpolator.Params>
Modifier and Type | Class and Description |
---|---|
static class |
CatmullRomInterpolator.Params |
static class |
CatmullRomInterpolator.Type |
Constructor and Description |
---|
CatmullRomInterpolator() |
Modifier and Type | Method and Description |
---|---|
static double |
interpolate(double[] p,
double[] time,
double t)
Unlike the other implementation here, which uses the default "uniform"
treatment of t, this computation is used to calculate the same values but
introduces the ability to "parameterize" the t values used in the
calculation.
|
List<XY> |
interpolate(XYSeries series,
CatmullRomInterpolator.Params params)
This method will calculate the Catmull-Rom interpolation curve, returning it as a list of Coord coordinate
objects.
|
List<XY> |
interpolate(XYSeries series,
int index,
CatmullRomInterpolator.Params params)
Given a list of control points, this will create a list of pointsPerSegment
points spaced uniformly along the resulting Catmull-Rom curve.
|
public List<XY> interpolate(XYSeries series, CatmullRomInterpolator.Params params)
interpolate
in interface Interpolator<CatmullRomInterpolator.Params>
series
- The list of original straight line points to calculate an interpolation from.IllegalArgumentException
- if pointsPerSegment is less than 2.public List<XY> interpolate(XYSeries series, int index, CatmullRomInterpolator.Params params)
series
- The list of control points, leading and ending with a
coordinate that is only used for controling the spline and is not visualized.index
- The index of control point p0, where p0, p1, p2, and p3 are
used in order to create a curve between p1 and p2.public static double interpolate(double[] p, double[] time, double t)
p
- An array of double values of length 4, where interpolation
occurs from p1 to p2.time
- An array of time measures of length 4, corresponding to each
p value.t
- the actual interpolation ratio from 0 to 1 representing the
position between p1 and p2 to interpolate the value.