void setup () { background(255); size(400,300); frameRate(20); } float a=180; float b=120; float d=a-b; float theta=0; int ang=0; float x,y,m,n; void draw (){ fill(255); rect(0,0,400,300); fill(0); noFill(); stroke(0); ellipse(200,150,360,240); line(20,150,380,150); line(200,30,200,270); x=a*cos(theta); y=b*sin(theta); m=d*cos(theta); n=d*sin(theta); line(200,150-n,200+x,150+y); fill(0); ellipse(200+x,150+y,8,8); fill(255,0,0); ellipse(200,150-n,8,8); fill(0,0,255); ellipse(200+m,150,8,8); ang=(ang-5)%360; theta=radians(ang); }