Class ParametricCurve

java.lang.Object
com.graphbuilder.curve.Curve
com.graphbuilder.curve.ParametricCurve
Direct Known Subclasses:
BezierCurve, BSpline, CardinalSpline, CatmullRomSpline, CubicBSpline, LagrangeCurve, NaturalCubicSpline

public abstract class ParametricCurve extends Curve
Curves that extend the ParametricCurve class are continuous and can use the BinaryCurveApproximationAlgorithm class to generate a sequence of points that approximate the curve. Note: Approximate means a finite set of points that are on the curve, not close to the curve.
See Also:
  • Constructor Details

  • Method Details

    • eval

      protected abstract void eval(double[] p)
      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.
    • getSampleLimit

      public abstract int getSampleLimit()
      The sample limit specifies how many additional subdivisions are done to ensure that there are no missed pieces of the curve. The sample limit must be >= 0.