3909N/A * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * The <code>CubicCurve2D</code> class defines a cubic parametric curve 0N/A * segment in {@code (x,y)} coordinate space. 0N/A * This class is only the abstract superclass for all objects which 0N/A * store a 2D cubic curve segment. 0N/A * The actual storage representation of the coordinates is left to 0N/A * @author Jim Graham 0N/A * A cubic parametric curve segment specified with 0N/A * {@code float} coordinates. 0N/A * The X coordinate of the start point 0N/A * of the cubic curve segment. 0N/A * The Y coordinate of the start point 0N/A * of the cubic curve segment. 0N/A * The X coordinate of the first control point 0N/A * of the cubic curve segment. 0N/A * The Y coordinate of the first control point 0N/A * of the cubic curve segment. 0N/A * The X coordinate of the second control point 0N/A * of the cubic curve segment. 0N/A * The Y coordinate of the second control point 0N/A * of the cubic curve segment. 0N/A * The X coordinate of the end point 0N/A * of the cubic curve segment. 0N/A * The Y coordinate of the end point 0N/A * of the cubic curve segment. 0N/A * Constructs and initializes a CubicCurve with coordinates 0N/A * (0, 0, 0, 0, 0, 0, 0, 0). 0N/A * Constructs and initializes a {@code CubicCurve2D} from 0N/A * the specified {@code float} coordinates. 0N/A * @param x1 the X coordinate for the start point 0N/A * of the resulting {@code CubicCurve2D} 0N/A * @param y1 the Y coordinate for the start point 0N/A * of the resulting {@code CubicCurve2D} 0N/A * @param ctrlx1 the X coordinate for the first control point 0N/A * of the resulting {@code CubicCurve2D} 0N/A * @param ctrly1 the Y coordinate for the first control point 0N/A * of the resulting {@code CubicCurve2D} 0N/A * @param ctrlx2 the X coordinate for the second control point 0N/A * of the resulting {@code CubicCurve2D} 0N/A * @param ctrly2 the Y coordinate for the second control point 0N/A * of the resulting {@code CubicCurve2D} 0N/A * @param x2 the X coordinate for the end point 0N/A * of the resulting {@code CubicCurve2D} 0N/A * @param y2 the Y coordinate for the end point 0N/A * of the resulting {@code CubicCurve2D} 0N/A * Sets the location of the end points and control points 0N/A * of this curve to the specified {@code float} coordinates. 0N/A * @param x1 the X coordinate used to set the start point 0N/A * of this {@code CubicCurve2D} 0N/A * @param y1 the Y coordinate used to set the start point 0N/A * of this {@code CubicCurve2D} 0N/A * @param ctrlx1 the X coordinate used to set the first control point 0N/A * of this {@code CubicCurve2D} 0N/A * @param ctrly1 the Y coordinate used to set the first control point 0N/A * of this {@code CubicCurve2D} 0N/A * @param ctrlx2 the X coordinate used to set the second control point 0N/A * of this {@code CubicCurve2D} 0N/A * @param ctrly2 the Y coordinate used to set the second control point 0N/A * of this {@code CubicCurve2D} 0N/A * @param x2 the X coordinate used to set the end point 0N/A * of this {@code CubicCurve2D} 0N/A * @param y2 the Y coordinate used to set the end point 0N/A * of this {@code CubicCurve2D} 0N/A * JDK 1.6 serialVersionUID 0N/A * A cubic parametric curve segment specified with 0N/A * {@code double} coordinates. 0N/A * The X coordinate of the start point 0N/A * of the cubic curve segment. 0N/A * The Y coordinate of the start point 0N/A * of the cubic curve segment. 0N/A * The X coordinate of the first control point 0N/A * of the cubic curve segment. 0N/A * The Y coordinate of the first control point 0N/A * of the cubic curve segment. 0N/A * The X coordinate of the second control point 0N/A * of the cubic curve segment. 0N/A * The Y coordinate of the second control point 0N/A * of the cubic curve segment. 0N/A * The X coordinate of the end point 0N/A * of the cubic curve segment. 0N/A * The Y coordinate of the end point 0N/A * of the cubic curve segment. 0N/A * Constructs and initializes a CubicCurve with coordinates 0N/A * (0, 0, 0, 0, 0, 0, 0, 0). 0N/A * Constructs and initializes a {@code CubicCurve2D} from 0N/A * the specified {@code double} coordinates. 0N/A * @param x1 the X coordinate for the start point 0N/A * of the resulting {@code CubicCurve2D} 0N/A * @param y1 the Y coordinate for the start point 0N/A * of the resulting {@code CubicCurve2D} 0N/A * @param ctrlx1 the X coordinate for the first control point 0N/A * of the resulting {@code CubicCurve2D} 0N/A * @param ctrly1 the Y coordinate for the first control point 0N/A * of the resulting {@code CubicCurve2D} 0N/A * @param ctrlx2 the X coordinate for the second control point 0N/A * of the resulting {@code CubicCurve2D} 0N/A * @param ctrly2 the Y coordinate for the second control point 0N/A * of the resulting {@code CubicCurve2D} 0N/A * @param x2 the X coordinate for the end point 0N/A * of the resulting {@code CubicCurve2D} 0N/A * @param y2 the Y coordinate for the end point 0N/A * of the resulting {@code CubicCurve2D} 0N/A * JDK 1.6 serialVersionUID 0N/A * This is an abstract class that cannot be instantiated directly. 0N/A * Type-specific implementation subclasses are available for 0N/A * instantiation and provide a number of formats for storing 0N/A * the information necessary to satisfy the various accessor 0N/A * @see java.awt.geom.CubicCurve2D.Float 0N/A * @see java.awt.geom.CubicCurve2D.Double 0N/A * Returns the X coordinate of the start point in double precision. 0N/A * @return the X coordinate of the start point of the 0N/A * {@code CubicCurve2D}. 0N/A * Returns the Y coordinate of the start point in double precision. 0N/A * @return the Y coordinate of the start point of the 0N/A * {@code CubicCurve2D}. 0N/A * Returns the start point. 0N/A * @return a {@code Point2D} that is the start point of 0N/A * the {@code CubicCurve2D}. 0N/A * Returns the X coordinate of the first control point in double precision. 0N/A * @return the X coordinate of the first control point of the 0N/A * {@code CubicCurve2D}. 0N/A * Returns the Y coordinate of the first control point in double precision. 0N/A * @return the Y coordinate of the first control point of the 0N/A * {@code CubicCurve2D}. 0N/A * Returns the first control point. 0N/A * @return a {@code Point2D} that is the first control point of 0N/A * the {@code CubicCurve2D}. 0N/A * Returns the X coordinate of the second control point 0N/A * in double precision. 0N/A * @return the X coordinate of the second control point of the 0N/A * {@code CubicCurve2D}. 0N/A * Returns the Y coordinate of the second control point 0N/A * in double precision. 0N/A * @return the Y coordinate of the second control point of the 0N/A * {@code CubicCurve2D}. 0N/A * Returns the second control point. 0N/A * @return a {@code Point2D} that is the second control point of 0N/A * the {@code CubicCurve2D}. 0N/A * Returns the X coordinate of the end point in double precision. 0N/A * @return the X coordinate of the end point of the 0N/A * {@code CubicCurve2D}. 0N/A * Returns the Y coordinate of the end point in double precision. 0N/A * @return the Y coordinate of the end point of the 0N/A * {@code CubicCurve2D}. 0N/A * Returns the end point. 0N/A * @return a {@code Point2D} that is the end point of 0N/A * the {@code CubicCurve2D}. 0N/A * Sets the location of the end points and control points of this curve 0N/A * to the specified double coordinates. 0N/A * @param x1 the X coordinate used to set the start point 0N/A * of this {@code CubicCurve2D} 0N/A * @param y1 the Y coordinate used to set the start point 0N/A * of this {@code CubicCurve2D} 0N/A * @param ctrlx1 the X coordinate used to set the first control point 0N/A * of this {@code CubicCurve2D} 0N/A * @param ctrly1 the Y coordinate used to set the first control point 0N/A * of this {@code CubicCurve2D} 0N/A * @param ctrlx2 the X coordinate used to set the second control point 0N/A * of this {@code CubicCurve2D} 0N/A * @param ctrly2 the Y coordinate used to set the second control point 0N/A * of this {@code CubicCurve2D} 0N/A * @param x2 the X coordinate used to set the end point 0N/A * of this {@code CubicCurve2D} 0N/A * @param y2 the Y coordinate used to set the end point 0N/A * of this {@code CubicCurve2D} 0N/A * Sets the location of the end points and control points of this curve 0N/A * to the double coordinates at the specified offset in the specified 0N/A * @param coords a double array containing coordinates 0N/A * @param offset the index of <code>coords</code> from which to begin 0N/A * setting the end points and control points of this curve 0N/A * to the coordinates contained in <code>coords</code> 0N/A * Sets the location of the end points and control points of this curve 0N/A * to the specified <code>Point2D</code> coordinates. 0N/A * @param p1 the first specified <code>Point2D</code> used to set the 0N/A * start point of this curve 0N/A * @param cp1 the second specified <code>Point2D</code> used to set the 0N/A * first control point of this curve 0N/A * @param cp2 the third specified <code>Point2D</code> used to set the 0N/A * second control point of this curve 0N/A * @param p2 the fourth specified <code>Point2D</code> used to set the 0N/A * end point of this curve 0N/A * Sets the location of the end points and control points of this curve 0N/A * to the coordinates of the <code>Point2D</code> objects at the specified 0N/A * offset in the specified array. 0N/A * @param pts an array of <code>Point2D</code> objects 0N/A * @param offset the index of <code>pts</code> from which to begin setting 0N/A * the end points and control points of this curve to the 0N/A * points contained in <code>pts</code> 0N/A * Sets the location of the end points and control points of this curve 0N/A * to the same as those in the specified <code>CubicCurve2D</code>. 0N/A * @param c the specified <code>CubicCurve2D</code> 0N/A * Returns the square of the flatness of the cubic curve specified 0N/A * by the indicated control points. The flatness is the maximum distance 0N/A * of a control point from the line connecting the end points. 0N/A * @param x1 the X coordinate that specifies the start point 0N/A * of a {@code CubicCurve2D} 0N/A * @param y1 the Y coordinate that specifies the start point 0N/A * of a {@code CubicCurve2D} 0N/A * @param ctrlx1 the X coordinate that specifies the first control point 0N/A * of a {@code CubicCurve2D} 0N/A * @param ctrly1 the Y coordinate that specifies the first control point 0N/A * of a {@code CubicCurve2D} 0N/A * @param ctrlx2 the X coordinate that specifies the second control point 0N/A * of a {@code CubicCurve2D} 0N/A * @param ctrly2 the Y coordinate that specifies the second control point 0N/A * of a {@code CubicCurve2D} 0N/A * @param x2 the X coordinate that specifies the end point 0N/A * of a {@code CubicCurve2D} 0N/A * @param y2 the Y coordinate that specifies the end point 0N/A * of a {@code CubicCurve2D} 0N/A * @return the square of the flatness of the {@code CubicCurve2D} 0N/A * represented by the specified coordinates. 0N/A * Returns the flatness of the cubic curve specified 0N/A * by the indicated control points. The flatness is the maximum distance 0N/A * of a control point from the line connecting the end points. 0N/A * @param x1 the X coordinate that specifies the start point 0N/A * of a {@code CubicCurve2D} 0N/A * @param y1 the Y coordinate that specifies the start point 0N/A * of a {@code CubicCurve2D} 0N/A * @param ctrlx1 the X coordinate that specifies the first control point 0N/A * of a {@code CubicCurve2D} 0N/A * @param ctrly1 the Y coordinate that specifies the first control point 0N/A * of a {@code CubicCurve2D} 0N/A * @param ctrlx2 the X coordinate that specifies the second control point 0N/A * of a {@code CubicCurve2D} 0N/A * @param ctrly2 the Y coordinate that specifies the second control point 0N/A * of a {@code CubicCurve2D} 0N/A * @param x2 the X coordinate that specifies the end point 0N/A * of a {@code CubicCurve2D} 0N/A * @param y2 the Y coordinate that specifies the end point 0N/A * of a {@code CubicCurve2D} 0N/A * @return the flatness of the {@code CubicCurve2D} 0N/A * represented by the specified coordinates. 0N/A * Returns the square of the flatness of the cubic curve specified 0N/A * by the control points stored in the indicated array at the 0N/A * indicated index. The flatness is the maximum distance 0N/A * of a control point from the line connecting the end points. 0N/A * @param coords an array containing coordinates 0N/A * @param offset the index of <code>coords</code> from which to begin 0N/A * getting the end points and control points of the curve 0N/A * @return the square of the flatness of the <code>CubicCurve2D</code> 0N/A * specified by the coordinates in <code>coords</code> at 0N/A * the specified offset. 0N/A * Returns the flatness of the cubic curve specified 0N/A * by the control points stored in the indicated array at the 0N/A * indicated index. The flatness is the maximum distance 0N/A * of a control point from the line connecting the end points. 0N/A * @param coords an array containing coordinates 0N/A * @param offset the index of <code>coords</code> from which to begin 0N/A * getting the end points and control points of the curve 0N/A * @return the flatness of the <code>CubicCurve2D</code> 0N/A * specified by the coordinates in <code>coords</code> at 0N/A * the specified offset. 0N/A * Returns the square of the flatness of this curve. The flatness is the 0N/A * maximum distance of a control point from the line connecting the 0N/A * @return the square of the flatness of this curve. 0N/A * Returns the flatness of this curve. The flatness is the 0N/A * maximum distance of a control point from the line connecting the 0N/A * @return the flatness of this curve. 0N/A * Subdivides this cubic curve and stores the resulting two 0N/A * subdivided curves into the left and right curve parameters. 0N/A * Either or both of the left and right objects may be the same 0N/A * as this object or null. 0N/A * @param left the cubic curve object for storing for the left or 0N/A * first half of the subdivided curve 0N/A * @param right the cubic curve object for storing for the right or 0N/A * second half of the subdivided curve 0N/A * Subdivides the cubic curve specified by the <code>src</code> parameter 0N/A * and stores the resulting two subdivided curves into the 0N/A * <code>left</code> and <code>right</code> curve parameters. 0N/A * Either or both of the <code>left</code> and <code>right</code> objects 0N/A * may be the same as the <code>src</code> object or <code>null</code>. 0N/A * @param src the cubic curve to be subdivided 0N/A * @param left the cubic curve object for storing the left or 0N/A * first half of the subdivided curve 0N/A * @param right the cubic curve object for storing the right or 0N/A * second half of the subdivided curve 0N/A * Subdivides the cubic curve specified by the coordinates 0N/A * stored in the <code>src</code> array at indices <code>srcoff</code> 0N/A * through (<code>srcoff</code> + 7) and stores the 0N/A * resulting two subdivided curves into the two result arrays at the 0N/A * corresponding indices. 0N/A * Either or both of the <code>left</code> and <code>right</code> 0N/A * arrays may be <code>null</code> or a reference to the same array 0N/A * as the <code>src</code> array. 0N/A * Note that the last point in the first subdivided curve is the 0N/A * same as the first point in the second subdivided curve. Thus, 0N/A * it is possible to pass the same array for <code>left</code> 0N/A * and <code>right</code> and to use offsets, such as <code>rightoff</code> 0N/A * equals (<code>leftoff</code> + 6), in order 0N/A * to avoid allocating extra storage for this common point. 0N/A * @param src the array holding the coordinates for the source curve 0N/A * @param srcoff the offset into the array of the beginning of the 0N/A * the 6 source coordinates 0N/A * @param left the array for storing the coordinates for the first 0N/A * half of the subdivided curve 0N/A * @param leftoff the offset into the array of the beginning of the 0N/A * the 6 left coordinates 0N/A * @param right the array for storing the coordinates for the second 0N/A * half of the subdivided curve 0N/A * @param rightoff the offset into the array of the beginning of the 0N/A * the 6 right coordinates 0N/A * Solves the cubic whose coefficients are in the <code>eqn</code> 0N/A * array and places the non-complex roots back into the same array, 0N/A * returning the number of roots. The solved cubic is represented 0N/A * eqn = {c, b, a, d} 0N/A * dx^3 + ax^2 + bx + c = 0 0N/A * A return value of -1 is used to distinguish a constant equation 0N/A * that might be always 0 or never 0 from an equation that has no 0N/A * @param eqn an array containing coefficients for a cubic 0N/A * @return the number of roots, or -1 if the equation is a constant. 0N/A * Solve the cubic whose coefficients are in the <code>eqn</code> 0N/A * array and place the non-complex roots into the <code>res</code> 0N/A * array, returning the number of roots. 0N/A * The cubic solved is represented by the equation: 0N/A * eqn = {c, b, a, d} 0N/A * dx^3 + ax^2 + bx + c = 0 0N/A * A return value of -1 is used to distinguish a constant equation, 0N/A * which may be always 0 or never 0, from an equation which has no 0N/A * @param eqn the specified array of coefficients to use to solve 0N/A * the cubic equation 0N/A * @param res the array that contains the non-complex roots 0N/A * resulting from the solution of the cubic equation 0N/A * @return the number of roots, or -1 if the equation is a constant 3442N/A /* normal form: x^3 + Ax^2 + Bx + C = 0 */ 3442N/A // substitute x = y - A/3 to eliminate quadratic term: 3442N/A // Since we actually need P/3 and Q/2 for all of the 3442N/A // calculations that follow, we will calculate 3442N/A // instead and use those values for simplicity of the code. 3442N/A double q =
1.0/
2 * (
2.0/
27 * A *
sq_A -
1.0/
3 * A * B + C);
3442N/A /* use Cardano's formula */ 3442N/A if (D <
0) {
/* Casus irreducibilis: three real solutions */ 3442N/A // Please see the comment in fixRoots marked 'XXX' before changing 3442N/A // any of the code in this case. 3442N/A // this must be done after the potential Arrays.copyOf 3442N/A // preconditions: eqn != res && eqn[3] != 0 && num > 1 3442N/A // This method tries to improve the accuracy of the roots of eqn (which 3442N/A // should be in res). It also might eliminate roots in res if it decideds 3442N/A // that they're not real roots. It will not check for roots that the 3442N/A // computation of res might have missed, so this method should only be 3442N/A // used when the roots in res have been computed using an algorithm 3442N/A // that never underestimates the number of roots (such as solveCubic above) 3442N/A // below we use critCount to possibly filter out roots that shouldn't 3442N/A // have been computed. We require that eqn[3] != 0, so eqn is a proper 3442N/A // cubic, which means that its limits at -/+inf are -/+inf or +/-inf. 3442N/A // Therefore, if critCount==2, the curve is shaped like a sideways S, 3442N/A // and it could have 1-3 roots. If critCount==0 it is monotonic, and 3442N/A // if critCount==1 it is monotonic with a single point where it is 3442N/A // flat. In the last 2 cases there can only be 1 root. So in cases 3442N/A // where num > 1 but critCount < 2, we eliminate all roots in res 3442N/A // this just tries to improve the accuracy of the computed 3442N/A // roots using Newton's method. 3442N/A // we only need fx0 and fxe for the sign of the polynomial 3442N/A // at -inf and +inf respectively, so we don't need to do 3442N/A // fx0 = solveEqn(eqn, 3, x0); fxe = solveEqn(eqn, 3, xe) 3442N/A // if critCount == 1 or critCount == 0, but num == 3 then 3442N/A // something has gone wrong. This branch and the one below 3442N/A // would ideally never execute, but if they do we can't know 3442N/A // which of the computed roots is closest to the real root; 3442N/A // therefore, we can't use refineRootWithHint. But even if 3442N/A // we did know, being here most likely means that the 3442N/A // curve is very flat close to two of the computed roots 3442N/A // (or maybe even all three). This might make Newton's method 3442N/A // fail altogether, which would be a pain to detect and fix. 3442N/A // This is why we use a very stable bisection method. 3442N/A }
else /* fx1 must be 0 */ {
3442N/A // XXX: here we assume that res[0] has better accuracy than res[1]. 3442N/A // This is true because this method is only used from solveCubic 3442N/A // which puts in res[0] the root that it would compute anyway even 3442N/A // if num==1. If this method is ever used from any other method, or 3442N/A // if the solveCubic implementation changes, this assumption should 3442N/A // be reevaluated, and the choice of goodRoot might have to become 3442N/A // goodRoot = (abs(eqn'(res[0])) > abs(eqn'(res[1]))) ? res[0] : res[1] 3442N/A // where eqn' is the derivative of eqn. 3442N/A // If a cubic curve really has 2 roots, one of those roots must be 3442N/A // at a critical point. That can't be goodRoot, so we compute x to 3442N/A // be the farthest critical point from goodRoot. If there are two 3442N/A // roots, x must be the second one, so we evaluate eqn at x, and if 3442N/A // it is zero (or close enough) we put x in res[1] (or badRoot, if 3442N/A // |solveEqn(eqn, 3, badRoot)| < |solveEqn(eqn, 3, x)| but this 3442N/A // shouldn't happen often). 3442N/A }
// else there can only be one root - goodRoot, and it is already in res[0] 0N/A for (
int i =
0; i <
3; i++) {
3442N/A * Computes M+1 where M is an upper bound for all the roots in of eqn. 3442N/A * The above link doesn't contain a proof, but I [dlila] proved it myself 3442N/A * so the result is reliable. The proof isn't difficult, but it's a bit 3442N/A * Precondition: eqn must represent a cubic polynomial 0N/A if (!(x *
0.0 + y *
0.0 ==
0.0)) {
0N/A /* Either x or y was infinite or NaN. 0N/A * A NaN always produces a negative response to any test 0N/A * and Infinity values cannot be "inside" any path so 0N/A * they should return false as well. 0N/A // We count the "Y" crossings to determine if the point is 0N/A // inside the curve bounded by its closing line. 0N/A public boolean intersects(
double x,
double y,
double w,
double h) {
0N/A // Trivially reject non-existant rectangles 0N/A if (w <=
0 || h <=
0) {
3353N/A // the intended return value is 3353N/A // numCrossings != 0 || numCrossings == Curve.RECT_INTERSECTS 3353N/A // but if (numCrossings != 0) numCrossings == INTERSECTS won't matter 3353N/A // and if !(numCrossings != 0) then numCrossings == 0, so 3353N/A // numCrossings != RECT_INTERSECT 0N/A public boolean contains(
double x,
double y,
double w,
double h) {
0N/A if (w <=
0 || h <=
0) {
3352N/A // we call this with the curve's direction reversed, because we wanted 3352N/A // to call rectCrossingsForLine first, because it's cheaper. 0N/A * Returns an iteration object that defines the boundary of the 0N/A * The iterator for this class is not multi-threaded safe, 0N/A * which means that this <code>CubicCurve2D</code> class does not 0N/A * guarantee that modifications to the geometry of this 0N/A * <code>CubicCurve2D</code> object do not affect any iterations of 0N/A * that geometry that are already in process. 0N/A * @param at an optional <code>AffineTransform</code> to be applied to the 0N/A * coordinates as they are returned in the iteration, or <code>null</code> 0N/A * if untransformed coordinates are desired 0N/A * @return the <code>PathIterator</code> object that returns the 0N/A * geometry of the outline of this <code>CubicCurve2D</code>, one 0N/A * segment at a time. 0N/A * Return an iteration object that defines the boundary of the 0N/A * The iterator for this class is not multi-threaded safe, 0N/A * which means that this <code>CubicCurve2D</code> class does not 0N/A * guarantee that modifications to the geometry of this 0N/A * <code>CubicCurve2D</code> object do not affect any iterations of 0N/A * that geometry that are already in process. 0N/A * @param at an optional <code>AffineTransform</code> to be applied to the 0N/A * coordinates as they are returned in the iteration, or <code>null</code> 0N/A * if untransformed coordinates are desired 0N/A * @param flatness the maximum amount that the control points 0N/A * for a given curve can vary from colinear before a subdivided 0N/A * curve is replaced by a straight line connecting the end points 0N/A * @return the <code>PathIterator</code> object that returns the 0N/A * geometry of the outline of this <code>CubicCurve2D</code>, 0N/A * one segment at a time. 0N/A * Creates a new object of the same class as this object. 0N/A * @return a clone of this instance. 0N/A * @exception OutOfMemoryError if there is not enough memory. 0N/A * @see java.lang.Cloneable 0N/A // this shouldn't happen, since we are Cloneable