Processing Forum
void setup() {smooth();size(400,400);rectMode(CENTER);}
float i = 180; // PIfloat amplitude = 200; // 400/2
void draw() {background(200);drawSquares(5, 3);}
void drawSquares(float s, int speed) {
float x = (width/2)+sin(radians(i))*amplitude;float y = (height/2)+cos(radians(i))*amplitude;
fill(0);rect(x,y,s,s);
i-=speed; //change radians at the rate of speedamplitude-=0.5; //decrease amplitude to spiral inwards
if(i==-180) {i=180; // reset radians}if(amplitude==0) {amplitude=width/2; // reset amplitude}}