Bezier Curves

Bezier curves are used to draw smooth, complex shapes based on mathematical control points. These points "pull" the path into a curve as it moves toward the end point.

Method Description
quadraticCurveTo(cp1x, cp1y, x, y) Draws a curve from the current drawing position to the specified (x,y) point using one control point (cp1x, cp1y).
bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) Draws a curve from the current drawing position to the specified (x,y) point using two control points. This allows for double-curved shapes.

Bezier Curve Example

This example draws both a quadratic curve (orange) and a cubic Bezier curve (blue):

View Output

The shapes created so far can be styled using colors and transparency. The next lesson explains how to implement those styles.