float angle=0; int numFactors = 20; float [] factors = new float[numFactors]; void setup() { size(400,180); randomiseFactors(); } void randomiseFactors() { for (int i=0;ib) stroke(255,0,0); else stroke(128,0,0); line(i+0,(height/2)-a,i+0,(height/2)-b); stroke(255); point(i+1,(height/2)-a); point(i+1,(height/2)-b); fi=(float)(width-i)*0.005f; a = (sin((angle+fi)*factors[index++])*height*scaler); a += (sin((angle+fi)*factors[index++])*height*scaler); a += (sin(angle+fi*factors[index++])*height*scaler); fi=(float)(width-i)*0.006f; b = (cos((angle+fi)*factors[index++])*height*scaler); b += (cos((angle+fi)*factors[index++])*height*scaler); b += (cos(angle+fi*factors[index++])*height*scaler); if (a>b) stroke(0,255,255); else stroke(0,155,155); line(i+1,(height/2)-a,i+1,(height/2)-b); stroke(0); point(i+1,(height/2)-a); point(i+1,(height/2)-b); } if (mousePressed) randomiseFactors(); }