public class CatmullRomSpline extends Object
| Modifier and Type | Method and Description |
|---|---|
static CatmullRomSpline |
create(List<? extends Point2D> points,
int stepsPerSegment,
double alpha)
Creates a new Catmull-Rom-Spline with the given control points.
|
static CatmullRomSpline |
create(List<? extends Point2D> points,
int stepsPerSegment,
double alpha,
boolean closed)
Creates a new Catmull-Rom-Spline with the given control points.
|
List<Point2D> |
getInterpolatedPoints()
Returns an unmodifiable list containing the interpolated points.
|
void |
setInterpolation(double alpha)
Set the alpha value determining the interpolation: For 0.0, the
spline is uniform.
|
void |
updateControlPoints(List<? extends Point2D> points)
Set the positions of the the control points so that they match
the given points.
|
public static CatmullRomSpline create(List<? extends Point2D> points, int stepsPerSegment, double alpha)
points - The control points. A deep copy of the given list
will be created internally. Thus, changes in the given list or
its points will not be reflected in this spline.stepsPerSegment - The number of interpolation steps per segmentalpha - The interpolation value. For 0.0, the
spline is uniform. For 0.5, the spline is centripetal. For
1.0, the spline is chordal.public static CatmullRomSpline create(List<? extends Point2D> points, int stepsPerSegment, double alpha, boolean closed)
points - The control points. A deep copy of the given list
will be created internally. Thus, changes in the given list or
its points will not be reflected in this spline.stepsPerSegment - The number of interpolation steps per segmentalpha - The interpolation value. For 0.0, the
spline is uniform. For 0.5, the spline is centripetal. For
1.0, the spline is chordal.closed - Whether the spline should be closedpublic void setInterpolation(double alpha)
alpha - The alpha valuepublic void updateControlPoints(List<? extends Point2D> points)
points - The control pointsIllegalArgumentException - If the number of points in the
given list does not match the number of points that was given
in the constructorpublic List<Point2D> getInterpolatedPoints()
Copyright © 2017. All rights reserved.