HTML5 Guidelines for Web Developers

(coco) #1

120 Chapter 5—Canvas


5.5.2 Bézier Curves


Canvas knows two kinds of Bézier curves: quadratic and cubic, the latter incor-
rectly referred to only as bezierCurveTo(). Figure 5.8 illustrates the former, and
Figure 5.9 illustrates the latter.

context.quadraticCurveTo(cpx, cpy, x, y)
context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y)

Figure 5.8 The path method “quadraticCurveTo()”
Free download pdf