/

HTML / CSS / JavaScript Tutorial

JavaScript canvas2d object method: bezierCurveTo()

[this page | pdf | back links]

The bezierCurveTo() method of the JavaScript DOM object returned by the getContext("2d") method applied to the HTML <canvas> element creates a cubic Bézier curve. To create a quadratic Bézier curve use the quadraticCurveTo() method.

 

It has the following syntax with the following parameters.

 

context.bezierCurveTo(x, y, r, startAngle, endAngle, counterclockwise)

 

Parameter

Required / Optional

Description

pt1x

Required

x-coordinate of first control point of curve

pt1y

Required

y-coordinate of first control point of curve

pt2x

Required

x-coordinate of second control point of curve

pt2y

Required

y-coordinate of second control point of curve

x

Required

x-coordinate of end point

y

Required

y-coordinate of end point

 


NAVIGATION LINKS
Contents | Prev | Next | JavaScript DOM (and BOM)


Desktop view | Switch to Mobile