Java Reference
In-Depth Information
CubicCurve
A CubicCurve defines a cubic Bézier parametric curve segment used to model
smooth curves. The startX , startY , endX , and endY points mark the ends of the
curve. The variables controlX1 , controlY1 , controlX2 , and controlY2 specify
the Bézier controls points that shape the curve. The following listing shows how
to create a curved line as shown in Figure 5.29. If you want a filled shape, set the
fill variable to a color or gradient.
CubicCurve {
startX: 10 startY: 10
endX: 100 endY: 100
controlX1: 20 controlY1: 0
controlX2: 80 controlY1: 110
stroke: Color.RED
strokeWidth: 2
fill: null
}
Figure 5.29
CubicCurve
QuadCurve
A QuadCurve defines a quadratic Bézier parametric curve segment. It is similar
to the CubicCurve , but it only uses one control point. The following listing shows
how to create a QuadCurve starting at point 10,20 and ending at point 100,100.
The control point is 75,0. The output for this curve is shown in Figure 5.30.
QuadCurve {
startX: 10 startY: 20
endX: 100 endY: 100
controlX: 75 controlY: 0
stroke: Color.RED
strokeWidth: 2
fill: null
}
Search WWH ::




Custom Search