View RSS Feed

Java AWT

Cubic Curve Segment

Rate this Entry
by , 03-06-2012 at 07:49 PM (578 Views)
CubicCurve2D class used to implement the shape interface. In x,y coordinates space, cubic parametric curve segment is presented by this class. In float & double precision, a cubic curve is specified by using these methods.

  • CubicCurve2D.Double
  • CubicCurve2D.Float


Curve setting methods are same for the CubicCurve2D and QuadraticCurve class, except 2nd control point.E.g.
Java Code:
// create new CubicCurve2D.Double
CubicCurve2D c = new CubicCurve2D.Double();
// draw CubicCurve2D.Double with set coordinates
c.setCurve(x1, y1, ctrlx1,
           ctrly1, ctrlx2, ctrly2, x2, y2);
g2.draw(c);

Submit "Cubic Curve Segment" to Facebook Submit "Cubic Curve Segment" to Digg Submit "Cubic Curve Segment" to del.icio.us Submit "Cubic Curve Segment" to StumbleUpon Submit "Cubic Curve Segment" to Google

Categories
Graphics

Comments