View RSS Feed

Java AWT

Quadratic Curve Segment

Rate this Entry
by , 03-06-2012 at 08:48 PM (1057 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.

  • QuadCurve2D.Double
  • QuadCureve2D.Float

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);

Submit "Quadratic Curve Segment" to Facebook Submit "Quadratic Curve Segment" to Digg Submit "Quadratic Curve Segment" to Submit "Quadratic Curve Segment" to StumbleUpon Submit "Quadratic Curve Segment" to Google