/** This sketch demonstrates how arcs work in Processing. 7-sep-2011/sklar The arc() function has 6 arguments: arc( x, y, width, height, start, stop ); x and y are the origin of the arc. If ellipseMode is CENTER (which is the default), then (x,y) is the center of the arc. width and height are the width and height of the bounding box that contains the arc (again, if ellipseMode is CENTER). start and stop are the endpoints of the arc, expressed in radians. 0 is due east, and drawing is done clockwise. Note that there are some handy constants: PI, HALF_PI, QUARTER_PI, TWO_PI (expressed in radians). **/ void setup() { size( 200, 200 ); background( #ffffff ); } void draw() { noFill(); // red circle, in the middle of the display window stroke( #ff0000 ); ellipse( width/2, height/2, 20, 20 ); // blue semi-circle (from east to west), below the red circle stroke( #0000ff ); arc( width/2, height/2, 40, 40, 0, PI ); // green quarter-circle (from east to south), below blue arc stroke( #00ff00 ); arc( width/2, height/2, 60, 60, 0, HALF_PI ); // yellow quarter-circle (from south to west), below bluen arc stroke( #ffff00 ); arc( width/2, height/2, 80, 80, HALF_PI, PI ); // magenta quarter-circle (from west to north), above red circle stroke( #ff00ff ); arc( width/2, height/2, 100, 100, PI, 3*HALF_PI ); // cyan quarter-circle (from north to east), above red circle stroke( #00ffff ); arc( width/2, height/2, 120, 120, 3*HALF_PI, TWO_PI ); // black semi-circle (from west to east), above magenta and cyan arcs stroke( #000000 ); arc( width/2, height/2, 140, 140, PI, TWO_PI ); }