JavaScript and HTML 5 are used to draw arcs and the starting and finishing angles are explained.
Copy and paste the code below in Notepad++ (or any other HTML5 editor) and run it.
Explanations
The two statements
ctx.arc(200,200,100,Math.PI/2,Math.PI);
and
ctx.arc(200,200,100,Math.PI/2,Math.PI,true); , included in the program above, are used to draw two arcs whose starting and finishing angles are the same but whose directions are different.
The method ctx.arc(xCenter,yCenter,R,startingAngle,finishingAngle); is used to draw an arc of a circle with radius R and a center at the point (xCenter,yCenter). The starting and ending angle of the arc define the size of the central angle of the arc. The direction of rotation from the starting angle to the finishing is by default a clockwise direction. If true is added as a parameter as in the statement
ctx.arc(200,200,100,Math.PI/2,Math.PI,true);, the direction of rotation is counterclockwise as shown in figures 1 and 2 below.
Copy and paste the code below in Notepad++ (or any other HTML5 editor) and run it.
Explanations
The same method arc() used to draw arcs is used to draw circles with the starting angle equal to 0 and a finishing angle equal to 2π as in the statement ctx.arc(200,200,150,0,2*Math.PI); included in the program above.