HTML5 Game - Drawing Bezier Curves

Introduction

The canvas supports drawing two kinds of Bezier curves: cubic and quadratic.

When drawing bezier curves we pick a start and end point and then add one or more control points that shape the curve.

The following table lists the curve methods.

Name
Description
Returns
bezierCurveTo(cx1, cy1, cx2, cy2,
x, y)
Draws a Bezier curve to the point (x, y) with the
control points (cx1, cy1) and (cx2, cy2).
void

quadraticCurveTo(cx, xy, x, y)

Draws a quadratic Bezier curve to (x, y) with the
control point (cx, cy).
void

Related Topic