Class BezierCurve


  • public class BezierCurve
    extends Curve

    General n-point Bezier curve implementation. The Bezier curve defines itself using all the points from the control-path specified by the group-iterator. To compute a single point on the curve requires O(n) multiplications where n is the group-size of the group-iterator. Thus, the Bezier curve is considered to be expensive, but it has several mathematical properties (not discussed here) that make it appealing. Figure 1 shows an example of a Bezier curve.

    The maximum number of points that the Bezier curve can use is 1030 because the evaluation of a point uses the nCr (n-choose-r) function. The computation uses double precision, and double precision cannot represent the result of 1031 choose i, where i = [500, 530].

    See Also:
    Curve, PascalsTriangle
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void appendTo​(com.macrofocus.high_d.parallelcoordinates.geometry.curve.MultiPath mp)
      The only requirement for this curve is the group-iterator must be in range or this method returns quietly.
      protected void eval​(double[] p)
      The eval method evaluates a point on a curve given a parametric value "t".
      int getSampleLimit()
      The sample limit specifies how many additional subdivisions are done to ensure that there are no missed pieces of the curve.
      void resetMemory()
      Resets the shared memory to the initial state.
      void setInterval​(double t_min, double t_max)
      Specifies the interval that the curve should define itself on.
      void setSampleLimit​(int limit)
      Sets the sample-limit.
      double t_max()
      Returns the finishing interval value.
      double t_min()
      Returns the starting interval value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • eval

        protected 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 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.
      • setSampleLimit

        public void setSampleLimit​(int limit)
        Sets the sample-limit. For more information on the sample-limit, see the BinaryCurveApproximationAlgorithm class. The default sample-limit is 1.
        See Also:
        BinaryCurveApproximationAlgorithm, getSampleLimit()
      • setInterval

        public void setInterval​(double t_min,
                                double t_max)
        Specifies the interval that the curve should define itself on. The default interval is [0.0, 1.0].
        See Also:
        t_min(), t_max()
      • appendTo

        public void appendTo​(com.macrofocus.high_d.parallelcoordinates.geometry.curve.MultiPath mp)
        The only requirement for this curve is the group-iterator must be in range or 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