HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
HTML Canvas Reference : Draw a quadratic Bézier curve
The numbers in the table specify the first browser version that fully supports the method.
Method | |||||
---|---|---|---|---|---|
quadraticCurveTo() | Yes | 9.0 | Yes | Yes | Yes |
The quadraticCurveTo() method adds a point to the current path by using the specified control points that represent a quadratic Bézier curve.
A quadratic Bézier curve requires two points. The first point is a control point that is used in the quadratic Bézier calculation and the second point is the ending point for the curve. The starting point for the curve is the last point in the current path. If a path does not exist, use the beginPath() and moveTo() methods to define a starting point.
Start point:
20,20
Control point:
20,100
End point:
200,20
JavaScript syntax: | context.quadraticCurveTo(cpx,cpy,x,y); |
---|
Parameter | Description | Play it |
---|---|---|
cpx | The x-coordinate of the Bézier control point | Play it » |
cpy | The y-coordinate of the Bézier control point | Play it » |
x | The x-coordinate of the ending point | Play it » |
y | The y-coordinate of the ending point | Play it » |
❮ HTML Canvas Reference