Quadratic Curve Segment
by, 03-06-2012 at 07:48 PM (983 Views)
QuadCurve2D class is used for the implementation of the Shape interface. In x,y coordinate segment, a quadratic parametric curve segment is represent by this given class. A quadratic class is specified by using these given subclasses, in float & double precision.
Curve’s control point & 2D endpoints are specified by using many setCurve methods. To directly define the coordinates, use coordinates of other points and a given array.
Quadratic curve is being set along with control point and same endpoints by using setCurve (QuadCurve2D).
It can be explained by using this code:
Java Code:// create new QuadCurve2D.Float QuadCurve2D q = new QuadCurve2D.Float(); // draw QuadCurve2D.Float with set coordinates q.setCurve(x1, y1, ctrlx, ctrly, x2, y2); g2.draw(q);