Package com.graphbuilder.curve
Class CardinalSpline
java.lang.Object
com.graphbuilder.curve.Curve
com.graphbuilder.curve.ParametricCurve
com.graphbuilder.curve.CardinalSpline
The Cardinal-spline passes through the points in the control-path specified by the group-iterator. However, the curve does not pass through the first or the last control-point, it begins at the second control-point and ends at the second last control-point.
There is a single parameter, alpha, that gives some control over the shape of the curve. When the value of alpha is 0.5 the curve becomes the CatmullRomSpline. Figure 1 shows an example of a CardinalSpline.

- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThe requirements for this curve are the group-iterator must be in-range and have a group size of at least 4.protected voideval(double[] p) The eval method evaluates a point on a curve given a parametric value "t".doublegetAlpha()Returns the value of alpha.intReturns a value of 1.voidsetAlpha(double a) Sets the value of alpha.Methods inherited from class com.graphbuilder.curve.Curve
getConnect, getControlPath, getGroupIterator, resetMemory, setConnect, setControlPath, setGroupIterator
-
Constructor Details
-
CardinalSpline
-
-
Method Details
-
eval
protected void eval(double[] p) Description copied from class:ParametricCurveThe eval method evaluates a point on a curve given a parametric value "t". The parametric value "t" is stored in the last index location of the specified double array. This value should not be changed. The dimension of the point to evaluate is p.length - 1. The result of the evaluation is placed in index locations 0 .. p.length - 2 (inclusive). The eval method should remain protected except for those curves that do no need any preparation to be done in the appendTo method.- Specified by:
evalin classParametricCurve
-
getAlpha
public double getAlpha()Returns the value of alpha. The default value is 0.5.- See Also:
-
setAlpha
public void setAlpha(double a) Sets the value of alpha.- See Also:
-
getSampleLimit
public int getSampleLimit()Returns a value of 1.- Specified by:
getSampleLimitin classParametricCurve
-
appendTo
The requirements for this curve are the group-iterator must be in-range and have a group size of at least 4. If these requirements are not met then this method raises IllegalArgumentException
-