com.graphbuilder.curve
Class NaturalCubicSpline

java.lang.Object
  extended bycom.graphbuilder.curve.Curve
      extended bycom.graphbuilder.curve.ParametricCurve
          extended bycom.graphbuilder.curve.NaturalCubicSpline

public class NaturalCubicSpline
extends ParametricCurve

The natural-cubic-spline is constructed using piecewise third order polynomials which pass through all the control-points specified by the group-iterator. The curve can be open or closed. Figure 1 shows an open curve and figure 2 shows a closed curve.


Field Summary
 
Fields inherited from class com.graphbuilder.curve.Curve
connect, cp, gi
 
Constructor Summary
NaturalCubicSpline(ControlPath cp, GroupIterator gi)
           
 
Method Summary
 void appendTo(MultiPath mp)
          The requirements for this curve are the group-iterator must be in-range and have a group size of at least 2.
protected  void eval(double[] p)
          The eval method evaluates a point on a curve given a parametric value "t".
 boolean getClosed()
          Returns the value of closed.
 int getSampleLimit()
          Returns a value of 1.
 void resetMemory()
          Resets the shared memory to the initial state.
 void setClosed(boolean b)
          The closed attribute determines which tri-diagonal matrix to solve.
 
Methods inherited from class com.graphbuilder.curve.Curve
getConnect, getControlPath, getGroupIterator, setConnect, setControlPath, setGroupIterator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NaturalCubicSpline

public NaturalCubicSpline(ControlPath cp,
                          GroupIterator gi)
Method Detail

eval

protected void eval(double[] p)
Description copied from class: ParametricCurve
The 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:
eval in class ParametricCurve

setClosed

public void setClosed(boolean b)
The closed attribute determines which tri-diagonal matrix to solve.

See Also:
getClosed()

getClosed

public boolean getClosed()
Returns the value of closed. The default value is false.

See Also:
setClosed(boolean)

getSampleLimit

public int getSampleLimit()
Returns a value of 1.

Specified by:
getSampleLimit in class ParametricCurve

appendTo

public void appendTo(MultiPath mp)
The requirements for this curve are the group-iterator must be in-range and have a group size of at least 2. If these requirements are not met then this method returns quietly.

Specified by:
appendTo in class Curve
See Also:
MultiPath, BinaryCurveApproximationAlgorithm

resetMemory

public void resetMemory()
Description copied from class: Curve
Resets the shared memory to the initial state.

Overrides:
resetMemory in class Curve