/** * Circles * * Math for artists who now need to program * ITP DriveBy, 10/2/2008 * Elie Zananiri - ez@silentlycrashing.net */ //---------------------------- // variables int centerX; int centerY; int radius = 50; //---------------------------- void setup() { // set up the applet size(300, 300); smooth(); frameRate(30); noCursor(); stroke(0); } //---------------------------- void draw() { background(255); // draw a circle manually fill(#176C21); centerX = width/4; centerY = height/2; beginShape(); for (int i=0; i < 360; i += 1) { float offsetX = radius * cos(radians(i)); float offsetY = radius * sin(radians(i)); vertex(centerX + offsetX, centerY + offsetY); } endShape(); // draw a circle using the built-in function fill(#1E2995); centerX = width*3/4; centerY = height/2; ellipse(centerX, centerY, radius*2, radius*2); }