// Polar Coordinate Experiment // By Patrick J. Hebron // February 5, 2010 float divsangle = 0.0; void setup() { size(500,500); frameRate(60); } void draw() { background(0); float divs = map(sin(radians(divsangle)),-1.0,1.0,4.0,50.0); float theta = 270.0; // start at top of circle float radius = 50.0; for(int i = 0; i < divs; i++) { float x = radius * cos(radians(-theta)); float y = radius * sin(radians(theta)); stroke(255-int(map(i,0,divs,45,215))); strokeWeight(2); point(width/2+x,height/2+y); theta += 360.0/divs; radius -= 55.0/divs; } divsangle += 1.0; if(divsangle > 360) divsangle = 0; }