int leng=36, depth=36; final int LOOPED=0, FIXED=1, FREE=2, MIXED=3; boolean circular=true; color colour; color colours[]=new color[leng]; //int sinArray[]=new int[721]; Chain[] chainStack=new Chain[depth]; float tinc = TWO_PI/150; float finc = TWO_PI/1000; int drawStyle=3, mode=2, squareSize=10; int dp=leng/2; // driver position class Chain { int ends=LOOPED; float amplitude=10, frequency=TWO_PI/180, phase=0, k=0.5; float v[]=new float [leng]; float r[]=new float [leng]; int xPos, yPos, oldxPos, oldyPos, c, i, t; void simulateStep(){ // Forces between neighbours: for (i=1;i