‘arc’ function is
used to draw an arc on the screen.
Syntax
arc(xCoordinate,
yCoordinate, width, height, angleToStartTheArc, angleToStopTheArc)
arc(xCoordinate,
yCoordinate, width, height, angleToStartTheArc, angleToStopTheArc, mode)
Below table summarize
the parameters of arc function.
Parameter
|
Data
Type
|
Description
|
xCoordinate
|
float
|
X-Coordinate of the
arc’s ellipse
|
yCoordinate
|
float
|
Y-Coordinate of the
arc’s ellipse
|
width
|
float
|
Width of the arc’s
ellipse
|
height
|
float
|
Height of the arc ellipse
|
angleToStartTheArc
|
float
|
Angle to start the
arc. It is specified in radians.
|
angleToStopTheArc
|
float
|
Angle to stop the
arc. It is specified in radians.
|
mode
|
float
|
Specify the
rendering technique, it can be PIE, OPEN, and CHORD. PIE is the default
value.
|
Return type of the
method arc is void.
HelloWorld.pde
size(800, 300); background(100, 135, 230); arc(50, 150, 75, 100, 0, 1); arc(150, 150, 75, 100, 0, 2); arc(250, 150, 75, 100, 0, 3); arc(350, 150, 75, 100, 0, 4); arc(450, 150, 75, 100, 0, 5); arc(550, 150, 75, 100, 0, 6); arc(650, 150, 75, 100, 0, 7);
Output
No comments:
Post a Comment