java.awt.geom
Class QuadCurve2D

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.geom.QuadCurve2D
All Implemented Interfaces:
Shape sample code for java.awt.Shape definition code for java.awt.Shape , Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable
Direct Known Subclasses:
QuadCurve2D.Double sample code for java.awt.geom.QuadCurve2D.Double definition code for java.awt.geom.QuadCurve2D.Double , QuadCurve2D.Float sample code for java.awt.geom.QuadCurve2D.Float definition code for java.awt.geom.QuadCurve2D.Float

public abstract class QuadCurve2D
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Shape sample code for java.awt.Shape definition code for java.awt.Shape , Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable

The QuadCurve2D class defines a quadratic parametric curve segment in (x, y) coordinate space.

This class is only the abstract superclass for all objects that store a 2D quadratic curve segment. The actual storage representation of the coordinates is left to the subclass.


Nested Class Summary
static class QuadCurve2D.Double sample code for java.awt.geom.QuadCurve2D.Double definition code for java.awt.geom.QuadCurve2D.Double
          A quadratic parametric curve segment specified with double coordinates.
static class QuadCurve2D.Float sample code for java.awt.geom.QuadCurve2D.Float definition code for java.awt.geom.QuadCurve2D.Float
          A quadratic parametric curve segment specified with float coordinates.
 
Constructor Summary
protected QuadCurve2D sample code for java.awt.geom.QuadCurve2D.QuadCurve2D() definition code for java.awt.geom.QuadCurve2D.QuadCurve2D() ()
          This is an abstract class that cannot be instantiated directly.
 
Method Summary
 Object sample code for java.lang.Object definition code for java.lang.Object clone sample code for java.awt.geom.QuadCurve2D.clone() definition code for java.awt.geom.QuadCurve2D.clone() ()
          Creates a new object of the same class and with the same contents as this object.
 boolean contains sample code for java.awt.geom.QuadCurve2D.contains(double, double) definition code for java.awt.geom.QuadCurve2D.contains(double, double) (double x, double y)
          Tests if a specified coordinate is inside the boundary of the shape of this QuadCurve2D.
 boolean contains sample code for java.awt.geom.QuadCurve2D.contains(double, double, double, double) definition code for java.awt.geom.QuadCurve2D.contains(double, double, double, double) (double x, double y, double w, double h)
          Tests if the interior of the shape of this QuadCurve2D entirely contains the specified set of rectangular coordinates.
 boolean contains sample code for java.awt.geom.QuadCurve2D.contains(java.awt.geom.Point2D) definition code for java.awt.geom.QuadCurve2D.contains(java.awt.geom.Point2D) (Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D  p)
          Tests if a specified Point2D is inside the boundary of the shape of this QuadCurve2D.
 boolean contains sample code for java.awt.geom.QuadCurve2D.contains(java.awt.geom.Rectangle2D) definition code for java.awt.geom.QuadCurve2D.contains(java.awt.geom.Rectangle2D) (Rectangle2D sample code for java.awt.geom.Rectangle2D definition code for java.awt.geom.Rectangle2D  r)
          Tests if the interior of the shape of this QuadCurve2D entirely contains the specified Rectangle2D.
 Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle getBounds sample code for java.awt.geom.QuadCurve2D.getBounds() definition code for java.awt.geom.QuadCurve2D.getBounds() ()
          Returns the bounding box of this QuadCurve2D.
abstract  Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D getCtrlPt sample code for java.awt.geom.QuadCurve2D.getCtrlPt() definition code for java.awt.geom.QuadCurve2D.getCtrlPt() ()
          Returns the control point.
abstract  double getCtrlX sample code for java.awt.geom.QuadCurve2D.getCtrlX() definition code for java.awt.geom.QuadCurve2D.getCtrlX() ()
          Returns the x coordinate of the control point in double precision.
abstract  double getCtrlY sample code for java.awt.geom.QuadCurve2D.getCtrlY() definition code for java.awt.geom.QuadCurve2D.getCtrlY() ()
          Returns the y coordinate of the control point in double precision.
 double getFlatness sample code for java.awt.geom.QuadCurve2D.getFlatness() definition code for java.awt.geom.QuadCurve2D.getFlatness() ()
          Returns the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of this QuadCurve2D.
static double getFlatness sample code for java.awt.geom.QuadCurve2D.getFlatness(double[], int) definition code for java.awt.geom.QuadCurve2D.getFlatness(double[], int) (double[] coords, int offset)
          Returns the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of the quadratic curve specified by the controlpoints stored in the indicated array at the indicated index.
static double getFlatness sample code for java.awt.geom.QuadCurve2D.getFlatness(double, double, double, double, double, double) definition code for java.awt.geom.QuadCurve2D.getFlatness(double, double, double, double, double, double) (double x1, double y1, double ctrlx, double ctrly, double x2, double y2)
          Returns the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of the quadratic curve specified by the indicated controlpoints.
 double getFlatnessSq sample code for java.awt.geom.QuadCurve2D.getFlatnessSq() definition code for java.awt.geom.QuadCurve2D.getFlatnessSq() ()
          Returns the square of the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of this QuadCurve2D.
static double getFlatnessSq sample code for java.awt.geom.QuadCurve2D.getFlatnessSq(double[], int) definition code for java.awt.geom.QuadCurve2D.getFlatnessSq(double[], int) (double[] coords, int offset)
          Returns the square of the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of the quadratic curve specified by the controlpoints stored in the indicated array at the indicated index.
static double getFlatnessSq sample code for java.awt.geom.QuadCurve2D.getFlatnessSq(double, double, double, double, double, double) definition code for java.awt.geom.QuadCurve2D.getFlatnessSq(double, double, double, double, double, double) (double x1, double y1, double ctrlx, double ctrly, double x2, double y2)
          Returns the square of the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of the quadratic curve specified by the indicated controlpoints.
abstract  Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D getP1 sample code for java.awt.geom.QuadCurve2D.getP1() definition code for java.awt.geom.QuadCurve2D.getP1() ()
          Returns the start point.
abstract  Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D getP2 sample code for java.awt.geom.QuadCurve2D.getP2() definition code for java.awt.geom.QuadCurve2D.getP2() ()
          Returns the end point.
 PathIterator sample code for java.awt.geom.PathIterator definition code for java.awt.geom.PathIterator getPathIterator sample code for java.awt.geom.QuadCurve2D.getPathIterator(java.awt.geom.AffineTransform) definition code for java.awt.geom.QuadCurve2D.getPathIterator(java.awt.geom.AffineTransform) (AffineTransform sample code for java.awt.geom.AffineTransform definition code for java.awt.geom.AffineTransform  at)
          Returns an iteration object that defines the boundary of the shape of this QuadCurve2D.
 PathIterator sample code for java.awt.geom.PathIterator definition code for java.awt.geom.PathIterator getPathIterator sample code for java.awt.geom.QuadCurve2D.getPathIterator(java.awt.geom.AffineTransform, double) definition code for java.awt.geom.QuadCurve2D.getPathIterator(java.awt.geom.AffineTransform, double) (AffineTransform sample code for java.awt.geom.AffineTransform definition code for java.awt.geom.AffineTransform  at, double flatness)
          Returns an iteration object that defines the boundary of the flattened shape of this QuadCurve2D.
abstract  double getX1 sample code for java.awt.geom.QuadCurve2D.getX1() definition code for java.awt.geom.QuadCurve2D.getX1() ()
          Returns the x coordinate of the start point in double in precision.
abstract  double getX2 sample code for java.awt.geom.QuadCurve2D.getX2() definition code for java.awt.geom.QuadCurve2D.getX2() ()
          Returns the x coordinate of the end point in double precision.
abstract  double getY1 sample code for java.awt.geom.QuadCurve2D.getY1() definition code for java.awt.geom.QuadCurve2D.getY1() ()
          Returns the y coordinate of the start point in double precision.
abstract  double getY2 sample code for java.awt.geom.QuadCurve2D.getY2() definition code for java.awt.geom.QuadCurve2D.getY2() ()
          Returns the y coordinate of the end point in double precision.
 boolean intersects sample code for java.awt.geom.QuadCurve2D.intersects(double, double, double, double) definition code for java.awt.geom.QuadCurve2D.intersects(double, double, double, double) (double x, double y, double w, double h)
          Tests if the shape of this QuadCurve2D intersects the interior of a specified set of rectangular coordinates.
 boolean intersects sample code for java.awt.geom.QuadCurve2D.intersects(java.awt.geom.Rectangle2D) definition code for java.awt.geom.QuadCurve2D.intersects(java.awt.geom.Rectangle2D) (Rectangle2D sample code for java.awt.geom.Rectangle2D definition code for java.awt.geom.Rectangle2D  r)
          Tests if the shape of this QuadCurve2D intersects the interior of a specified Rectangle2D.
 void setCurve sample code for java.awt.geom.QuadCurve2D.setCurve(double[], int) definition code for java.awt.geom.QuadCurve2D.setCurve(double[], int) (double[] coords, int offset)
          Sets the location of the endpoints and controlpoints of this QuadCurve2D to the double coordinates at the specified offset in the specified array.
abstract  void setCurve sample code for java.awt.geom.QuadCurve2D.setCurve(double, double, double, double, double, double) definition code for java.awt.geom.QuadCurve2D.setCurve(double, double, double, double, double, double) (double x1, double y1, double ctrlx, double ctrly, double x2, double y2)
          Sets the location of the endpoints and controlpoint of this curve to the specified double coordinates.
 void setCurve sample code for java.awt.geom.QuadCurve2D.setCurve(java.awt.geom.Point2D[], int) definition code for java.awt.geom.QuadCurve2D.setCurve(java.awt.geom.Point2D[], int) (Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D [] pts, int offset)
          Sets the location of the endpoints and controlpoints of this QuadCurve2D to the coordinates of the Point2D objects at the specified offset in the specified array.
 void setCurve sample code for java.awt.geom.QuadCurve2D.setCurve(java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D) definition code for java.awt.geom.QuadCurve2D.setCurve(java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D) (Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D  p1, Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D  cp, Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D  p2)
          Sets the location of the endpoints and controlpoint of this QuadCurve2D to the specified Point2D coordinates.
 void setCurve sample code for java.awt.geom.QuadCurve2D.setCurve(java.awt.geom.QuadCurve2D) definition code for java.awt.geom.QuadCurve2D.setCurve(java.awt.geom.QuadCurve2D) (QuadCurve2D sample code for java.awt.geom.QuadCurve2D definition code for java.awt.geom.QuadCurve2D  c)
          Sets the location of the endpoints and controlpoint of this QuadCurve2D to the same as those in the specified QuadCurve2D.
static int solveQuadratic sample code for java.awt.geom.QuadCurve2D.solveQuadratic(double[]) definition code for java.awt.geom.QuadCurve2D.solveQuadratic(double[]) (double[] eqn)
          Solves the quadratic whose coefficients are in the eqn array and places the non-complex roots back into the same array, returning the number of roots.
static int solveQuadratic sample code for java.awt.geom.QuadCurve2D.solveQuadratic(double[], double[]) definition code for java.awt.geom.QuadCurve2D.solveQuadratic(double[], double[]) (double[] eqn, double[] res)
          Solves the quadratic whose coefficients are in the eqn array and places the non-complex roots into the res array, returning the number of roots.
static void subdivide sample code for java.awt.geom.QuadCurve2D.subdivide(double[], int, double[], int, double[], int) definition code for java.awt.geom.QuadCurve2D.subdivide(double[], int, double[], int, double[], int) (double[] src, int srcoff, double[] left, int leftoff, double[] right, int rightoff)
          Subdivides the quadratic curve specified by the coordinates stored in the src array at indices srcoff through srcoff + 5 and stores the resulting two subdivided curves into the two result arrays at the corresponding indices.
 void subdivide sample code for java.awt.geom.QuadCurve2D.subdivide(java.awt.geom.QuadCurve2D, java.awt.geom.QuadCurve2D) definition code for java.awt.geom.QuadCurve2D.subdivide(java.awt.geom.QuadCurve2D, java.awt.geom.QuadCurve2D) (QuadCurve2D sample code for java.awt.geom.QuadCurve2D definition code for java.awt.geom.QuadCurve2D  left, QuadCurve2D sample code for java.awt.geom.QuadCurve2D definition code for java.awt.geom.QuadCurve2D  right)
          Subdivides this QuadCurve2D and stores the resulting two subdivided curves into the left and right curve parameters.
static void subdivide sample code for java.awt.geom.QuadCurve2D.subdivide(java.awt.geom.QuadCurve2D, java.awt.geom.QuadCurve2D, java.awt.geom.QuadCurve2D) definition code for java.awt.geom.QuadCurve2D.subdivide(java.awt.geom.QuadCurve2D, java.awt.geom.QuadCurve2D, java.awt.geom.QuadCurve2D) (QuadCurve2D sample code for java.awt.geom.QuadCurve2D definition code for java.awt.geom.QuadCurve2D  src, QuadCurve2D sample code for java.awt.geom.QuadCurve2D definition code for java.awt.geom.QuadCurve2D  left, QuadCurve2D sample code for java.awt.geom.QuadCurve2D definition code for java.awt.geom.QuadCurve2D  right)
          Subdivides the quadratic curve specified by the src parameter and stores the resulting two subdivided curves into the left and right curve parameters.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 
Methods inherited from interface java.awt.Shape sample code for java.awt.Shape definition code for java.awt.Shape
getBounds2D sample code for java.awt.Shape.getBounds2D() definition code for java.awt.Shape.getBounds2D()
 

Constructor Detail

QuadCurve2D sample code for java.awt.geom.QuadCurve2D() definition code for java.awt.geom.QuadCurve2D()

protected QuadCurve2D()
This is an abstract class that cannot be instantiated directly. Type-specific implementation subclasses are available for instantiation and provide a number of formats for storing the information necessary to satisfy the various accessor methods below.

See Also:
QuadCurve2D.Float sample code for java.awt.geom.QuadCurve2D.Float definition code for java.awt.geom.QuadCurve2D.Float , QuadCurve2D.Double sample code for java.awt.geom.QuadCurve2D.Double definition code for java.awt.geom.QuadCurve2D.Double
Method Detail

getX1 sample code for java.awt.geom.QuadCurve2D.getX1() definition code for java.awt.geom.QuadCurve2D.getX1()

public abstract double getX1()
Returns the x coordinate of the start point in double in precision.

Returns:
the x coordinate of the start point.

getY1 sample code for java.awt.geom.QuadCurve2D.getY1() definition code for java.awt.geom.QuadCurve2D.getY1()

public abstract double getY1()
Returns the y coordinate of the start point in double precision.

Returns:
the y coordinate of the start point.

getP1 sample code for java.awt.geom.QuadCurve2D.getP1() definition code for java.awt.geom.QuadCurve2D.getP1()

public abstract Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D  getP1()
Returns the start point.

Returns:
a Point2D that is the start point of this QuadCurve2D.

getCtrlX sample code for java.awt.geom.QuadCurve2D.getCtrlX() definition code for java.awt.geom.QuadCurve2D.getCtrlX()

public abstract double getCtrlX()
Returns the x coordinate of the control point in double precision.

Returns:
x coordinate the control point

getCtrlY sample code for java.awt.geom.QuadCurve2D.getCtrlY() definition code for java.awt.geom.QuadCurve2D.getCtrlY()

public abstract double getCtrlY()
Returns the y coordinate of the control point in double precision.

Returns:
the y coordinate of the control point.

getCtrlPt sample code for java.awt.geom.QuadCurve2D.getCtrlPt() definition code for java.awt.geom.QuadCurve2D.getCtrlPt()

public abstract Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D  getCtrlPt()
Returns the control point.

Returns:
a Point2D that is the control point of this Point2D.

getX2 sample code for java.awt.geom.QuadCurve2D.getX2() definition code for java.awt.geom.QuadCurve2D.getX2()

public abstract double getX2()
Returns the x coordinate of the end point in double precision.

Returns:
the x coordiante of the end point.

getY2 sample code for java.awt.geom.QuadCurve2D.getY2() definition code for java.awt.geom.QuadCurve2D.getY2()

public abstract double getY2()
Returns the y coordinate of the end point in double precision.

Returns:
the y coordinate of the end point.

getP2 sample code for java.awt.geom.QuadCurve2D.getP2() definition code for java.awt.geom.QuadCurve2D.getP2()

public abstract Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D  getP2()
Returns the end point.

Returns:
a Point object that is the end point of this Point2D.

setCurve sample code for java.awt.geom.QuadCurve2D.setCurve(double, double, double, double, double, double) definition code for java.awt.geom.QuadCurve2D.setCurve(double, double, double, double, double, double)

public abstract void setCurve(double x1,
                              double y1,
                              double ctrlx,
                              double ctrly,
                              double x2,
                              double y2)
Sets the location of the endpoints and controlpoint of this curve to the specified double coordinates.

Parameters:
x1, y1 - the coordinates of the starting point
ctrlx, ctrly - the coordinates of the control point
x2, y2 - the coordinates of the ending point

setCurve sample code for java.awt.geom.QuadCurve2D.setCurve(double[], int) definition code for java.awt.geom.QuadCurve2D.setCurve(double[], int)

public void setCurve(double[] coords,
                     int offset)
Sets the location of the endpoints and controlpoints of this QuadCurve2D to the double coordinates at the specified offset in the specified array.

Parameters:
coords - the array containing coordinate values
offset - the index into the array from which to start getting the coordinate values and assigning them to this QuadCurve2D

setCurve sample code for java.awt.geom.QuadCurve2D.setCurve(java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D) definition code for java.awt.geom.QuadCurve2D.setCurve(java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D)

public void setCurve(Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D  p1,
                     Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D  cp,
                     Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D  p2)
Sets the location of the endpoints and controlpoint of this QuadCurve2D to the specified Point2D coordinates.

Parameters:
p1 - the starting point
cp - the control point
p2 - the ending point

setCurve sample code for java.awt.geom.QuadCurve2D.setCurve(java.awt.geom.Point2D[], int) definition code for java.awt.geom.QuadCurve2D.setCurve(java.awt.geom.Point2D[], int)

public void setCurve(Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D [] pts,
                     int offset)
Sets the location of the endpoints and controlpoints of this QuadCurve2D to the coordinates of the Point2D objects at the specified offset in the specified array.

Parameters:
pts - an array containing Point2D that define coordinate values
offset - the index into pts at which to start getting the coordinate values and assigning them to this QuadCurve2D

setCurve sample code for java.awt.geom.QuadCurve2D.setCurve(java.awt.geom.QuadCurve2D) definition code for java.awt.geom.QuadCurve2D.setCurve(java.awt.geom.QuadCurve2D)

public void setCurve(QuadCurve2D sample code for java.awt.geom.QuadCurve2D definition code for java.awt.geom.QuadCurve2D  c)
Sets the location of the endpoints and controlpoint of this QuadCurve2D to the same as those in the specified QuadCurve2D.

Parameters:
c - the specified QuadCurve2D

getFlatnessSq sample code for java.awt.geom.QuadCurve2D.getFlatnessSq(double, double, double, double, double, double) definition code for java.awt.geom.QuadCurve2D.getFlatnessSq(double, double, double, double, double, double)

public static double getFlatnessSq(double x1,
                                   double y1,
                                   double ctrlx,
                                   double ctrly,
                                   double x2,
                                   double y2)
Returns the square of the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of the quadratic curve specified by the indicated controlpoints.

Parameters:
x1, y1 - the coordinates of the starting point
ctrlx, ctrly - the coordinates of the control point
x2, y2 - the coordinates of the ending point
Returns:
the square of the flatness of the quadratic curve defined by the specified coordinates.

getFlatness sample code for java.awt.geom.QuadCurve2D.getFlatness(double, double, double, double, double, double) definition code for java.awt.geom.QuadCurve2D.getFlatness(double, double, double, double, double, double)

public static double getFlatness(double x1,
                                 double y1,
                                 double ctrlx,
                                 double ctrly,
                                 double x2,
                                 double y2)
Returns the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of the quadratic curve specified by the indicated controlpoints.

Parameters:
x1, y1 - the coordinates of the starting point
ctrlx, ctrly - the coordinates of the control point
x2, y2 - the coordinates of the ending point
Returns:
the flatness of the quadratic curve defined by the specified coordinates.

getFlatnessSq sample code for java.awt.geom.QuadCurve2D.getFlatnessSq(double[], int) definition code for java.awt.geom.QuadCurve2D.getFlatnessSq(double[], int)

public static double getFlatnessSq(double[] coords,
                                   int offset)
Returns the square of the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of the quadratic curve specified by the controlpoints stored in the indicated array at the indicated index.

Parameters:
coords - an array containing coordinate values
offset - the index into coords at which to to start getting the values from the array and assigning them to a quadratic curve
Returns:
the flatness of the quadratic curve that is defined by the values in the specified array at the specified index.

getFlatness sample code for java.awt.geom.QuadCurve2D.getFlatness(double[], int) definition code for java.awt.geom.QuadCurve2D.getFlatness(double[], int)

public static double getFlatness(double[] coords,
                                 int offset)
Returns the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of the quadratic curve specified by the controlpoints stored in the indicated array at the indicated index.

Parameters:
coords - an array containing coordinate values
offset - the index into coords at which to start getting the coordinate values and assigning them to a quadratic curve
Returns:
the flatness of a quadratic curve defined by the specified array at the specified offset.

getFlatnessSq sample code for java.awt.geom.QuadCurve2D.getFlatnessSq() definition code for java.awt.geom.QuadCurve2D.getFlatnessSq()

public double getFlatnessSq()
Returns the square of the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of this QuadCurve2D.

Returns:
the square of the flatness of this QuadCurve2D.

getFlatness sample code for java.awt.geom.QuadCurve2D.getFlatness() definition code for java.awt.geom.QuadCurve2D.getFlatness()

public double getFlatness()
Returns the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of this QuadCurve2D.

Returns:
the flatness of this QuadCurve2D.

subdivide sample code for java.awt.geom.QuadCurve2D.subdivide(java.awt.geom.QuadCurve2D, java.awt.geom.QuadCurve2D) definition code for java.awt.geom.QuadCurve2D.subdivide(java.awt.geom.QuadCurve2D, java.awt.geom.QuadCurve2D)

public void subdivide(QuadCurve2D sample code for java.awt.geom.QuadCurve2D definition code for java.awt.geom.QuadCurve2D  left,
                      QuadCurve2D sample code for java.awt.geom.QuadCurve2D definition code for java.awt.geom.QuadCurve2D  right)
Subdivides this QuadCurve2D and stores the resulting two subdivided curves into the left and right curve parameters. Either or both of the left and right objects can be the same as this QuadCurve2D or null.

Parameters:
left - the QuadCurve2D object for storing the left or first half of the subdivided curve
right - the QuadCurve2D object for storing the right or second half of the subdivided curve

subdivide sample code for java.awt.geom.QuadCurve2D.subdivide(java.awt.geom.QuadCurve2D, java.awt.geom.QuadCurve2D, java.awt.geom.QuadCurve2D) definition code for java.awt.geom.QuadCurve2D.subdivide(java.awt.geom.QuadCurve2D, java.awt.geom.QuadCurve2D, java.awt.geom.QuadCurve2D)

public static void subdivide(QuadCurve2D sample code for java.awt.geom.QuadCurve2D definition code for java.awt.geom.QuadCurve2D  src,
                             QuadCurve2D sample code for java.awt.geom.QuadCurve2D definition code for java.awt.geom.QuadCurve2D  left,
                             QuadCurve2D sample code for java.awt.geom.QuadCurve2D definition code for java.awt.geom.QuadCurve2D  right)
Subdivides the quadratic curve specified by the src parameter and stores the resulting two subdivided curves into the left and right curve parameters. Either or both of the left and right objects can be the same as the src object or null.

Parameters:
src - the quadratic curve to be subdivided
left - the QuadCurve2D object for storing the left or first half of the subdivided curve
right - the QuadCurve2D object for storing the right or second half of the subdivided curve

subdivide sample code for java.awt.geom.QuadCurve2D.subdivide(double[], int, double[], int, double[], int) definition code for java.awt.geom.QuadCurve2D.subdivide(double[], int, double[], int, double[], int)

public static void subdivide(double[] src,
                             int srcoff,
                             double[] left,
                             int leftoff,
                             double[] right,
                             int rightoff)
Subdivides the quadratic curve specified by the coordinates stored in the src array at indices srcoff through srcoff + 5 and stores the resulting two subdivided curves into the two result arrays at the corresponding indices. Either or both of the left and right arrays can be null or a reference to the same array and offset as the src array. Note that the last point in the first subdivided curve is the same as the first point in the second subdivided curve. Thus, it is possible to pass the same array for left and right and to use offsets such that rightoff equals leftoff + 4 in order to avoid allocating extra storage for this common point.

Parameters:
src - the array holding the coordinates for the source curve
srcoff - the offset into the array of the beginning of the the 6 source coordinates
left - the array for storing the coordinates for the first half of the subdivided curve
leftoff - the offset into the array of the beginning of the the 6 left coordinates
right - the array for storing the coordinates for the second half of the subdivided curve
rightoff - the offset into the array of the beginning of the the 6 right coordinates

solveQuadratic sample code for java.awt.geom.QuadCurve2D.solveQuadratic(double[]) definition code for java.awt.geom.QuadCurve2D.solveQuadratic(double[])

public static int solveQuadratic(double[] eqn)
Solves the quadratic whose coefficients are in the eqn array and places the non-complex roots back into the same array, returning the number of roots. The quadratic solved is represented by the equation:
     eqn = {C, B, A};
     ax^2 + bx + c = 0
 
A return value of -1 is used to distinguish a constant equation, which might be always 0 or never 0, from an equation that has no zeroes.

Parameters:
eqn - the array that contains the quadratic coefficients
Returns:
the number of roots, or -1 if the equation is a constant

solveQuadratic sample code for java.awt.geom.QuadCurve2D.solveQuadratic(double[], double[]) definition code for java.awt.geom.QuadCurve2D.solveQuadratic(double[], double[])

public static int solveQuadratic(double[] eqn,
                                 double[] res)
Solves the quadratic whose coefficients are in the eqn array and places the non-complex roots into the res array, returning the number of roots. The quadratic solved is represented by the equation:
     eqn = {C, B, A};
     ax^2 + bx + c = 0
 
A return value of -1 is used to distinguish a constant equation, which might be always 0 or never 0, from an equation that has no zeroes.

Parameters:
eqn - the specified array of coefficients to use to solve the quadratic equation
res - the array that contains the non-complex roots resulting from the solution of the quadratic equation
Returns:
the number of roots, or -1 if the equation is a constant.

contains sample code for java.awt.geom.QuadCurve2D.contains(double, double) definition code for java.awt.geom.QuadCurve2D.contains(double, double)

public boolean contains(double x,
                        double y)
Tests if a specified coordinate is inside the boundary of the shape of this QuadCurve2D.

Specified by:
contains sample code for java.awt.Shape.contains(double, double) definition code for java.awt.Shape.contains(double, double) in interface Shape sample code for java.awt.Shape definition code for java.awt.Shape
Parameters:
x, y - the specified coordinates
Returns:
true if the specified coordinate is inside the boundary of the shape of this QuadCurve2D; false otherwise.

contains sample code for java.awt.geom.QuadCurve2D.contains(java.awt.geom.Point2D) definition code for java.awt.geom.QuadCurve2D.contains(java.awt.geom.Point2D)

public boolean contains(Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D  p)
Tests if a specified Point2D is inside the boundary of the shape of this QuadCurve2D.

Specified by:
contains sample code for java.awt.Shape.contains(java.awt.geom.Point2D) definition code for java.awt.Shape.contains(java.awt.geom.Point2D) in interface Shape sample code for java.awt.Shape definition code for java.awt.Shape
Parameters:
p - the specified Point2D
Returns:
true if the specified Point2D is inside the boundary of the shape of this QuadCurve2D.

intersects sample code for java.awt.geom.QuadCurve2D.intersects(double, double, double, double) definition code for java.awt.geom.QuadCurve2D.intersects(double, double, double, double)

public boolean intersects(double x,
                          double y,
                          double w,
                          double h)
Tests if the shape of this QuadCurve2D intersects the interior of a specified set of rectangular coordinates.

Specified by:
intersects sample code for java.awt.Shape.intersects(double, double, double, double) definition code for java.awt.Shape.intersects(double, double, double, double) in interface Shape sample code for java.awt.Shape definition code for java.awt.Shape
Parameters:
x, y - the coordinates of the upper-left corner of the specified rectangular area
w - the width of the specified rectangular area
h - the height of the specified rectangular area
Returns:
true if the shape of this QuadCurve2D intersects the interior of the specified set of rectangular coordinates; false otherwise.
See Also:
Area sample code for java.awt.geom.Area definition code for java.awt.geom.Area

intersects sample code for java.awt.geom.QuadCurve2D.intersects(java.awt.geom.Rectangle2D) definition code for java.awt.geom.QuadCurve2D.intersects(java.awt.geom.Rectangle2D)