float ang; void setup() { size (200,200); background (255); framerate (50); rectMode(CENTER); } void draw () { background (255); stroke(0,0,0,50); // black lines translate (100,100); //move origin of red square line(0,-width, 0, width); // draw vertical line line(-height, 0, height, 0); // draw horizontal line noFill (); stroke(255,0,0,50); // red square(static square) rect (0,0,50,50); rotate (ang); translate (-75,-75); //move origin of black square stroke(0,0,0); // black square noFill (); rect (75,75,50,50); // draw black square(moving square) ang += TWO_PI/360; }