int x=151,y=152; void setup() { size(300, 300); background(0); clock(); framerate(20); } void clock(){ smooth(); fill(154); ellipse(x, y, 161, 161); fill(180); strokeWeight(2); ellipse(x, y, 106, 106); fill(200); ellipse(x, y, 62, 62); strokeWeight(1); stroke(80); for(int i=0; i<12; i++){ line(x+53*sin(i*PI/6), y+53*cos(i*PI/6), x+80*sin(i*PI/6), y+80*cos(i*PI/6)); } stroke(0); } void draw() { clock(); float s = second(); // Values from 0 - 59 float m = minute(); // Values from 0 - 59 float h = hour(); // Values from 0 - 23 line(x+31*cos((m+s/60)*PI/30-PI/2), y+31*sin((m+s/60)*PI/30-PI/2), x+53*cos((m+s/60)*PI/30-PI/2), y+53*sin((m+s/60)*PI/30-PI/2)); line(x, y, x+31*cos(((h%12)+m/60)*PI/6-PI/2), y+31*sin(((h%12)+m/60)*PI/6-PI/2)); }