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.
Modifier and Type | Class and Description |
---|---|
public static class | QuadCurve2D.Double
A quadratic parametric curve segment specified with
|
public static class | QuadCurve2D.Float
A quadratic parametric curve segment specified with
|
Modifier and Type | Field and Description |
---|---|
private static final int | |
private static final int | |
private static final int | |
private static final int | |
private static final int |
Access | Constructor and Description |
---|---|
protected |
Modifier and Type | Method and Description |
---|---|
public Object | Returns: a clone of this instance.Overrides java. |
public boolean | contains(double
the specified X coordinate to be tested x, double the specified Y coordinate to be tested y)Implements java. Shape , as described by the
definition of insideness.
|
public boolean | contains(Point2D
the specified p)Point2D to be testedImplements java. Point2D is inside the boundary
of the Shape , as described by the
definition of insideness.
|
public boolean | contains(double
the X coordinate of the upper-left corner
of the specified rectangular area x, double the Y coordinate of the upper-left corner
of the specified rectangular area y, double the width of the specified rectangular area w, double the height of the specified rectangular area h)Implements java. Shape entirely contains
the specified rectangular area.
|
public boolean | contains(Rectangle2D
The specified r)Rectangle2D Implements java. Shape entirely contains the
specified Rectangle2D .
|
private static int | evalQuadratic(double[] vals, int num, boolean include0, boolean include1, double[] inflect, double c1, double ctrl, double c2)
Evaluate the t values in the first num slots of the vals[] array and place the evaluated values back into the same array. |
private static void | fillEqn(double[] eqn, double val, double c1, double cp, double c2)
Fill an array with the coefficients of the parametric equation in t, ready for solving against val with solveQuadratic. |
public Rectangle | getBounds()
Implements java. Rectangle that completely encloses the
Shape .
|
public Rectangle2D | getBounds2D()
Implements java. Shape than the getBounds method.
|
public abstract Point2D | |
public abstract double | Returns: X coordinate the control pointReturns the X coordinate of the control point in
|
public abstract double | Returns: the Y coordinate of the control point.Returns the Y coordinate of the control point in
|
public static double | Returns: the flatness of the quadratic curve defined by the specified coordinates.the X coordinate of the start point x1, double the Y coordinate of the start point y1, double the X coordinate of the control point ctrlx, double the Y coordinate of the control point ctrly, double the X coordinate of the end point x2, double the Y coordinate of the end point y2)Returns the flatness, or maximum distance of a control point from the line connecting the end points, of the quadratic curve specified by the indicated control points. |
public static double | Returns: the flatness of a quadratic curve defined by the specified array at the specified offset.an array containing coordinate values coords, int the index into offset)coords from which to
start getting the coordinate valuesReturns the flatness, or maximum distance of a control point from the line connecting the end points, of the quadratic curve specified by the control points stored in the indicated array at the indicated index. |
public double | Returns: the flatness of thisQuadCurve2D .Returns the flatness, or maximum distance of a
control point from the line connecting the end points, of this
|
public static double | Returns: the square of the flatness of the quadratic curve defined by the specified coordinates.the X coordinate of the start point x1, double the Y coordinate of the start point y1, double the X coordinate of the control point ctrlx, double the Y coordinate of the control point ctrly, double the X coordinate of the end point x2, double the Y coordinate of the end point y2)Returns the square of the flatness, or maximum distance of a control point from the line connecting the end points, of the quadratic curve specified by the indicated control points. |
public static double | Returns: the flatness of the quadratic curve that is defined by the values in the specified array at the specified index.an array containing coordinate values coords, int the index into offset)coords from which to
to start getting the values from the arrayReturns the square of the flatness, or maximum distance of a control point from the line connecting the end points, of the quadratic curve specified by the control points stored in the indicated array at the indicated index. |
public double | Returns: the square of the flatness of thisQuadCurve2D .Returns the square of the flatness, or maximum distance of a
control point from the line connecting the end points, of this
|
public abstract Point2D | |
public abstract Point2D | |
public PathIterator | Returns: aPathIterator object that defines the boundary
of the shape.an optional at)AffineTransform to apply to the
shape boundaryImplements java. QuadCurve2D .
|
public PathIterator | Returns: aPathIterator object that defines the
flattened boundary of the shape.an optional at, double AffineTransform to apply
to the boundary of the shapethe maximum distance that the control points for a
subdivided curve can be with respect to a line connecting
the end points of this curve before this curve is
replaced by a straight line connecting the end points. flatness)Implements java. QuadCurve2D .
|
private static int | getTag(double coord, double low, double high)
Determine where coord lies with respect to the range from low to high. |
public abstract double | Returns: the X coordinate of the start point.Returns the X coordinate of the start point in
|
public abstract double | Returns: the x coordinate of the end point.Returns the X coordinate of the end point in
|
public abstract double | Returns: the Y coordinate of the start point.Returns the Y coordinate of the start point in
|
public abstract double | Returns: the Y coordinate of the end point.Returns the Y coordinate of the end point in
|
public boolean | intersects(double
the X coordinate of the upper-left corner
of the specified rectangular area x, double the Y coordinate of the upper-left corner
of the specified rectangular area y, double the width of the specified rectangular area w, double the height of the specified rectangular area h)Implements java. Shape intersects the
interior of a specified rectangular area.
|
public boolean | intersects(Rectangle2D
the specified r)Rectangle2D Implements java. Shape intersects the
interior of a specified Rectangle2D .
|
private static boolean | inwards(int pttag, int opt1tag, int opt2tag)
Determine if the pttag represents a coordinate that is already in its test range, or is on the border with either of the two opttags representing another coordinate that is "towards the inside" of that test range. |
public abstract void | setCurve(double
the X coordinate of the start point x1, double the Y coordinate of the start point y1, double the X coordinate of the control point ctrlx, double the Y coordinate of the control point ctrly, double the X coordinate of the end point x2, double the Y coordinate of the end point y2)Sets the location of the end points and control point of this curve
to the specified |
public void | setCurve(double[]
the array containing coordinate values coords, int the index into the array from which to start
getting the coordinate values and assigning them to this
offset)QuadCurve2D Sets the location of the end points and control points of this
|
public void | |
public void | setCurve(Point2D[]
an array containing pts, int Point2D that define
coordinate valuesthe index into offset)pts from which to start
getting the coordinate values and assigning them to this
QuadCurve2D Sets the location of the end points and control points of this
|
public void | setCurve(QuadCurve2D
the specified c)QuadCurve2D Sets the location of the end points and control point of this
|
public static int | Returns: the number of roots, or-1 if the equation is
a constantthe array that contains the quadratic coefficients eqn)Solves the quadratic whose coefficients are in the |
public static int | Returns: the number of roots, or-1 if the equation is
a constant.the specified array of coefficients to use to solve
the quadratic equation eqn, double[] the array that contains the non-complex roots
resulting from the solution of the quadratic equation res)Solves the quadratic whose coefficients are in the |
public void | subdivide(QuadCurve2D
the left, QuadCurve2D QuadCurve2D object for storing the
left or first half of the subdivided curvethe right)QuadCurve2D object for storing the
right or second half of the subdivided curveSubdivides this |
public static void | subdivide(QuadCurve2D
the quadratic curve to be subdivided src, QuadCurve2D the left, QuadCurve2D QuadCurve2D object for storing the
left or first half of the subdivided curvethe right)QuadCurve2D object for storing the
right or second half of the subdivided curveSubdivides the quadratic curve specified by the |
public static void | subdivide(double[]
the array holding the coordinates for the source curve src, int the offset into the array of the beginning of the
the 6 source coordinates srcoff, double[] the array for storing the coordinates for the first
half of the subdivided curve left, int the offset into the array of the beginning of the
the 6 left coordinates leftoff, double[] the array for storing the coordinates for the second
half of the subdivided curve right, int the offset into the array of the beginning of the
the 6 right coordinates rightoff)Subdivides the quadratic curve specified by the coordinates
stored in the |