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
Canvas Object : Create a circle
The numbers in the table specify the first browser version that fully supports the method.
Method | |||||
---|---|---|---|---|---|
arc() | 4.0 | 9.0 | 3.6 | 4.0 | 10.1 |
The arc() method creates an arc/curve (used to create circles, or parts of circles).
Center
100, 75
Start angle
0
End angle
1.5 * Math.PI
JavaScript syntax: | context.arc(x, y, r, sAngle, eAngle, counterclockwise); |
---|
Parameter | Description | Play it |
---|---|---|
x | The x-coordinate of the center of the circle | Play it » |
y | The y-coordinate of the center of the circle | Play it » |
r | The radius of the circle | Play it » |
sAngle | The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) | Play it » |
eAngle | The ending angle, in radians | Play it » |
counterclockwise | Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. | Play it » |
❮ Canvas Object