antiClockwise = false
#

Arc

Ellipse, circle and various arcs can be drawn by use of arc function.

arc functions use radians instead of degrees. To convert degrees to radians use the following formula:

var radians = degrees * Math.PI/180;

Note that arc defines the path only. In order to draw the arc we have apply stroke() function.

Functions:

Properties:

To Do

Try the following options:

ctx.beginPath();
ctx.lineWidth = "3";
ctx.strokeStyle = "black";
ctx.moveTo(80, 100);
ctx.lineTo(240, 100);
ctx.moveTo(200, 60);
ctx.lineTo(200, 220);
ctx.stroke();
ctx.beginPath();
ctx.strokeStyle = "red";
ctx.lineWidth = "5";
ctx.moveTo(120, 100);   // Create a starting point.
ctx.arcTo(200, 100, 200, 220, 75); // Create an arc.
ctx.stroke();