CubicCurve2D class defines a cubic parametric curve
segment in (x,y) coordinate space.
This class is only the abstract superclass for all objects which store a 2D cubic curve segment. The actual storage representation of the coordinates is left to the subclass.
| Modifier and Type | Class and Description |
|---|---|
| public static class | CubicCurve2D.
A cubic parametric curve segment specified with
|
| public static class | CubicCurve2D.
A cubic parametric curve segment specified with
|
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private static double | |
| private static double | |
| public Object | Returns: a clone of this instance.Overrides java. Creates a new object of the same class as this object. |
| public boolean | contains(double x, double y)
Implements java. Tests if the specified coordinates are inside the boundary of the
|
| public boolean | contains(Point2D p)
Implements java. Tests if a specified |
| public boolean | contains(double x, double y, double w, double h)
Implements java. Tests if the interior of the |
| public boolean | contains(Rectangle2D r)
Implements java. Tests if the interior of the |
| private static int | |
| public Rectangle | getBounds()
Implements java. Returns an integer |
| public Rectangle2D | getBounds2D()
Implements java. Returns a high precision and more accurate bounding box of
the |
| public abstract Point2D | Returns: aPoint2D that is the first control point of
the CubicCurve2D.Returns the first control point. |
| public abstract Point2D | Returns: aPoint2D that is the second control point of
the CubicCurve2D.Returns the second control point. |
| public abstract double | Returns: the X coordinate of the first control point of theCubicCurve2D.Returns the X coordinate of the first control point in double precision. |
| public abstract double | Returns: the X coordinate of the second control point of theCubicCurve2D.Returns the X coordinate of the second control point in double precision. |
| public abstract double | Returns: the Y coordinate of the first control point of theCubicCurve2D.Returns the Y coordinate of the first control point in double precision. |
| public abstract double | Returns: the Y coordinate of the second control point of theCubicCurve2D.Returns the Y coordinate of the second control point in double precision. |
| public static double | Returns: the flatness of theCubicCurve2D
represented by the specified coordinates.the X coordinate that specifies the start point
of a x1, double CubicCurve2Dthe Y coordinate that specifies the start point
of a y1, double CubicCurve2Dthe X coordinate that specifies the first control point
of a ctrlx1, double CubicCurve2Dthe Y coordinate that specifies the first control point
of a ctrly1, double CubicCurve2Dthe X coordinate that specifies the second control point
of a ctrlx2, double CubicCurve2Dthe Y coordinate that specifies the second control point
of a ctrly2, double CubicCurve2Dthe X coordinate that specifies the end point
of a x2, double CubicCurve2Dthe Y coordinate that specifies the end point
of a y2)CubicCurve2DReturns the flatness of the cubic curve specified by the indicated control points. |
| public static double | Returns: the flatness of theCubicCurve2D
specified by the coordinates in coords at
the specified offset.an array containing coordinates coords, int the index of offset)coords from which to begin
getting the end points and control points of the curveReturns the flatness of the cubic curve specified by the control points stored in the indicated array at the indicated index. |
| public double | |
| public static double | Returns: the square of the flatness of theCubicCurve2D
represented by the specified coordinates.the X coordinate that specifies the start point
of a x1, double CubicCurve2Dthe Y coordinate that specifies the start point
of a y1, double CubicCurve2Dthe X coordinate that specifies the first control point
of a ctrlx1, double CubicCurve2Dthe Y coordinate that specifies the first control point
of a ctrly1, double CubicCurve2Dthe X coordinate that specifies the second control point
of a ctrlx2, double CubicCurve2Dthe Y coordinate that specifies the second control point
of a ctrly2, double CubicCurve2Dthe X coordinate that specifies the end point
of a x2, double CubicCurve2Dthe Y coordinate that specifies the end point
of a y2)CubicCurve2DReturns the square of the flatness of the cubic curve specified by the indicated control points. |
| public static double | Returns: the square of the flatness of theCubicCurve2D
specified by the coordinates in coords at
the specified offset.an array containing coordinates coords, int the index of offset)coords from which to begin
getting the end points and control points of the curveReturns the square of the flatness of the cubic curve specified by the control points stored in the indicated array at the indicated index. |
| public double | Returns: the square of the flatness of this curve.Returns the square of the flatness of this curve. |
| public abstract Point2D | |
| public abstract Point2D | |
| public PathIterator | Returns: thePathIterator object that returns the
geometry of the outline of this CubicCurve2D, one
segment at a time.an optional at)AffineTransform to be applied to the
coordinates as they are returned in the iteration, or null
if untransformed coordinates are desiredImplements java. Returns an iteration object that defines the boundary of the shape. |
| public PathIterator | Returns: thePathIterator object that returns the
geometry of the outline of this CubicCurve2D,
one segment at a time.an optional at, double AffineTransform to be applied to the
coordinates as they are returned in the iteration, or null
if untransformed coordinates are desiredthe maximum amount that the control points
for a given curve can vary from colinear before a subdivided
curve is replaced by a straight line connecting the end points flatness)Implements java. Return an iteration object that defines the boundary of the flattened shape. |
| private static double | |
| public abstract double | Returns: the X coordinate of the start point of theCubicCurve2D.Returns the X coordinate of the start point in double precision. |
| public abstract double | Returns: the X coordinate of the end point of theCubicCurve2D.Returns the X coordinate of the end point in double precision. |
| public abstract double | Returns: the Y coordinate of the start point of theCubicCurve2D.Returns the Y coordinate of the start point in double precision. |
| public abstract double | Returns: the Y coordinate of the end point of theCubicCurve2D.Returns the Y coordinate of the end point in double precision. |
| private static boolean | |
| public boolean | intersects(double x, double y, double w, double h)
Implements java. Tests if the interior of the |
| public boolean | intersects(Rectangle2D r)
Implements java. Tests if the interior of the |
| private static boolean | |
| private static boolean | |
| private int | |
| private static double | |
| public abstract void | setCurve(double
the X coordinate used to set the start point
of this x1, double CubicCurve2Dthe Y coordinate used to set the start point
of this y1, double CubicCurve2Dthe X coordinate used to set the first control point
of this ctrlx1, double CubicCurve2Dthe Y coordinate used to set the first control point
of this ctrly1, double CubicCurve2Dthe X coordinate used to set the second control point
of this ctrlx2, double CubicCurve2Dthe Y coordinate used to set the second control point
of this ctrly2, double CubicCurve2Dthe X coordinate used to set the end point
of this x2, double CubicCurve2Dthe Y coordinate used to set the end point
of this y2)CubicCurve2DSets the location of the end points and control points of this curve to the specified double coordinates. |
| public void | setCurve(double[]
a double array containing coordinates coords, int the index of offset)coords from which to begin
setting the end points and control points of this curve
to the coordinates contained in coordsSets the location of the end points and control points of this curve to the double coordinates at the specified offset in the specified array. |
| public void | setCurve(Point2D
the first specified p1, Point2D Point2D used to set the
start point of this curvethe second specified cp1, Point2D Point2D used to set the
first control point of this curvethe third specified cp2, Point2D Point2D used to set the
second control point of this curvethe fourth specified p2)Point2D used to set the
end point of this curveSets the location of the end points and control points of this curve
to the specified |
| public void | setCurve(Point2D[]
an array of pts, int Point2D objectsthe index of offset)pts from which to begin setting
the end points and control points of this curve to the
points contained in ptsSets the location of the end points and control points of this curve
to the coordinates of the |
| public void | setCurve(CubicCurve2D
the specified c)CubicCurve2DSets the location of the end points and control points of this curve
to the same as those in the specified |
| public static int | Returns: the number of roots, or -1 if the equation is a constant.an array containing coefficients for a cubic eqn)Solves the cubic whose coefficients are in the |
| public static int | Returns: the number of roots, or -1 if the equation is a constantthe specified array of coefficients to use to solve
the cubic equation eqn, double[] the array that contains the non-complex roots
resulting from the solution of the cubic equation res)Solve the cubic whose coefficients are in the |
| private static double | |
| public void | subdivide(CubicCurve2D
the cubic curve object for storing for the left or
first half of the subdivided curve left, CubicCurve2D the cubic curve object for storing for the right or
second half of the subdivided curve right)Subdivides this cubic curve and stores the resulting two subdivided curves into the left and right curve parameters. |
| public static void | subdivide(CubicCurve2D
the cubic curve to be subdivided src, CubicCurve2D the cubic curve object for storing the left or
first half of the subdivided curve left, CubicCurve2D the cubic curve object for storing the right or
second half of the subdivided curve right)Subdivides the cubic 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 cubic curve specified by the coordinates
stored in the |
| private static boolean |