Reference arc()


Draws an arc.

An arc is a section of an ellipse defined by the x, y, w, and h parameters. x and y set the location of the arc's center. w and h set the arc's width and height. See ellipse() and ellipseMode() for more details.

The fifth and sixth parameters, start and stop, set the angles between which to draw the arc. Arcs are always drawn clockwise from start to stop. Angles are always given in radians.

The seventh parameter, mode, is optional. It determines the arc's fill style. The fill modes are a semi-circle (OPEN), a closed semi-circle (CHORD), or a closed pie segment (PIE).

The eighth parameter, detail, is also optional. It determines how many vertices are used to draw the arc in WebGL mode. The default value is 25.



arc(x, y, w, h, start, stop, [mode], [detail])



x-coordinate of the arc's ellipse.


y-coordinate of the arc's ellipse.


width of the arc's ellipse by default.


height of the arc's ellipse by default.


angle to start the arc, specified in radians.


angle to stop the arc, specified in radians.


optional parameter to determine the way of drawing the arc. either CHORD, PIE, or OPEN.


optional parameter for WebGL mode only. This is to specify the number of vertices that makes up the perimeter of the arc. Default value is 25. Won't draw a stroke for a detail of more than 50.

Related References