float x1 = 0; float y1 = 0; int r = 200; float theta1 = 0.0; float theta2 = 0.0; int angle; int xspacing1 = 16; int xspacing2 = 16; float dx1; float dx2; float period1 = 500.0; float period2 = 500.0; float x2 = 0; float y2 = 0; void setup(){ size(1136,640); background(0); stroke(255); dx1 = (TWO_PI/ period1) * xspacing1; dx2 = (TWO_PI/ period2) * xspacing2; } void draw(){ background(0); theta1 += 0.02; theta2 += 0.021; // line(0,320,1160,320); float x1 = theta1; float x2 = theta2; for(angle=0;angle<720;angle+=10){ x1 = (angle)/180* PI; x2 = (angle)/180* PI; y1 = -1*r*sin(x1+theta1); y2 = -1*r*sin(x2+theta2); ellipse(x1*100,y1+320,10,10); ellipse(x2*110,y2+320,10,10); point(x1*100,320,x1*100,320); x1+=dx1; x2+=dx2; } }