//Brooks Pierce //10-02-2009 //CSCI 273 //Assignment 4 float px, py; float angle; float radius = 10; float frequency = 2.8; float x; void setup(){ size(600, 600); background (#000000); } void draw(){ background (#000000); rectMode(CENTER); noStroke(); //eighth set (furthest outside) fill(#000033); ellipse(width/2, height/2, radius*128, radius*128); //seventh set fill(#000055); ellipse(width/2, height/2, radius*64, radius*64); // rotates red circle around circle px = width/2 + cos(radians(angle))*-(radius*32); py = height/2 + sin(radians(angle))*-(radius*32); fill(#990000); ellipse (px, py, 128, 128); // rotates yellow circle around circle px = width/2 + cos(radians(angle))*(radius*32); py = height/2 + sin(radians(angle))*(radius*32); fill(#cccc00); ellipse (px, py, 128, 128); //sixth set fill(#000077); ellipse(width/2, height/2, radius*32, radius*32); // rotates yellow circle around circle px = width/2 + cos(radians(angle))*-(radius*16); py = height/2 + sin(radians(angle))*-(radius*16); fill(#cccc00); ellipse (px, py, 64, 64); // rotates red circle around circle px = width/2 + cos(radians(angle))*(radius*16); py = height/2 + sin(radians(angle))*(radius*16); fill(#990000); ellipse (px, py, 64, 64); //fifth set fill(#000099); ellipse(width/2, height/2, radius*16, radius*16); // rotates red circle around circle px = width/2 + cos(radians(angle))*-(radius*8); py = height/2 + sin(radians(angle))*-(radius*8); fill(#990000); ellipse (px, py, 32, 32); // rotates yellow circle around circle px = width/2 + cos(radians(angle))*(radius*8); py = height/2 + sin(radians(angle))*(radius*8); fill(#cccc00); ellipse (px, py, 32, 32); //fourth set fill(#0000bb); ellipse(width/2, height/2, radius*8, radius*8); // rotates yellow circle around circle px = width/2 + cos(radians(angle))*-(radius*4); py = height/2 + sin(radians(angle))*-(radius*4); fill(#cccc00); ellipse (px, py, 16, 16); // rotates red circle around circle px = width/2 + cos(radians(angle))*(radius*4); py = height/2 + sin(radians(angle))*(radius*4); fill(#990000); ellipse (px, py, 16, 16); //third set fill(#0000cc); ellipse(width/2, height/2, radius*4, radius*4); // rotates red circle around circle px = width/2 + cos(radians(angle))*-(radius*2); py = height/2 + sin(radians(angle))*-(radius*2); fill(#990000); ellipse (px, py, 8, 8); // rotates yellow circle around circle px = width/2 + cos(radians(angle))*(radius*2); py = height/2 + sin(radians(angle))*(radius*2); fill(#cccc00); ellipse (px, py, 8, 8); // second set fill(#0000ee); ellipse(width/2, height/2, radius*2, radius*2); // rotates yellow circle around circle px = width/2 + cos(radians(angle))*-(radius); py = height/2 + sin(radians(angle))*-(radius); fill(#cccc00); ellipse (px, py, 4, 4); // rotates red circle around circle px = width/2 + cos(radians(angle))*(radius); py = height/2 + sin(radians(angle))*(radius); fill(#990000); ellipse (px, py, 4, 4); //first set (center) fill(#0000ff); ellipse(width/2, height/2, radius, radius); // rotates red circle around circle px = width/2 + cos(radians(angle))*-(radius/2); py = height/2 + sin(radians(angle))*-(radius/2); fill(#990000); ellipse (px, py, 2, 2); // rotates yellow circle around circle px = width/2 + cos(radians(angle))*(radius/2); py = height/2 + sin(radians(angle))*(radius/2); fill(#cccc00); ellipse (px, py, 2, 2); // keep reinitializing to 0, to avoid // flashing during redrawing angle -= frequency; x+=1; }