Documentation of 'vmm3d.planecurve.PlaneCurve' Java class
PlaneCurve
vmm3d.planecurve

Class PlaneCurve

  • All Implemented Interfaces:
    java.util.EventListener, javax.swing.event.ChangeListener, Decorateable, Parameterizable
    Direct Known Subclasses:
    PlaneCurveParametric


    public abstract class PlaneCurve
    extends Exhibit
    A PlaneCurve represents a curve in the xy-plane that is defined by an array of points. Since a null value in that array is interpreted as a break in the curve, the curve can in fact consist of multiple segments.
    • Constructor Detail

      • PlaneCurve

        public PlaneCurve()
    • Method Detail

      • getPointCount

        public int getPointCount()
        Returns the number of points in the Point array for this curve (including any null values). If the point array has not yet been created, because the curve has not yet been drawn, then the return value is zero.
      • getPoint

        public java.awt.geom.Point2D getPoint(int index)
        Get one of the points in the point array that defines this curve.
        Parameters:
        index - the index of the point in the point array. The value must be in the range from 0 to one less than the value returned by getPointCount(), or an error of type NullPointerException or ArrayIndexOutOfBoundsError will occur.
        Returns:
        the point at the specified index in the point array. This can be null if the specified position in the array holds a null value.
      • fillRandomSquare

        public java.awt.geom.Point2D[] fillRandomSquare(int numPoints)
        public Point2D[] fillRandomSquare() puts numPoints random points into a square of edge length 2.
      • initializeMovingSquare

        public java.awt.geom.Point2D[] initializeMovingSquare(int numPoints)
        initializeMovingSquare(numPoints) Initializes the array MovingSquare[] and its elements only once for each new call of a curve exhibit. Avoids garbage collection while the dotted square moves along a curve.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.