Class RMQuadratic

All Implemented Interfaces:
RMArchiver.Archiving, Cloneable
Direct Known Subclasses:
RMBezier

public class RMQuadratic extends RMLine
This class models a simple quadratic curve, providing methods for extracting points, distance calculation, bisection, hit detection and such.
  • Field Details

  • Constructor Details

    • RMQuadratic

      public RMQuadratic()
      Creates a new quadratic curve.
    • RMQuadratic

      public RMQuadratic(RMPoint startPoint, RMPoint controlPoint, RMPoint endPoint)
      Creates a new quadratic curve for this gvein start point, control point and end point.
  • Method Details

    • setCurve

      public void setCurve(float x1, float y1, float x2, float y2, float x3, float y3)
      Sets the curve values.
    • setCurve

      public void setCurve(RMPoint p1, RMPoint p2, RMPoint p3)
      Sets the curve values.
    • getPoint

      public RMPoint getPoint(double t)
      Returns the point on this curve at the parametric location t (defined from 0-1).
      Overrides:
      getPoint in class RMLine
    • getDistanceQuadratic

      public double getDistanceQuadratic(RMPoint aPoint)
      Returns the minimum distance from the given point to the curve.
    • subdivide

      public void subdivide(RMQuadratic left, RMQuadratic right)
      Subdivides this curve into the given left and right curves.
    • getMinX

      public float getMinX()
      Returns the min x point of this bezier.
      Overrides:
      getMinX in class RMLine
    • getMinY

      public float getMinY()
      Returns the min y point of this bezier.
      Overrides:
      getMinY in class RMLine
    • getMaxX

      public float getMaxX()
      Returns the max x point of this bezier.
      Overrides:
      getMaxX in class RMLine
    • getMaxY

      public float getMaxY()
      Returns the max y point of this bezier.
      Overrides:
      getMaxY in class RMLine