int numSegments = 15; float[] x = new float[numSegments]; float[] y = new float[numSegments]; float[] angle = new float[numSegments]; float segLength = 20; float targetX, targetY; void setup() { size(300, 200); smooth(); strokeWeight(15.0); stroke(int(random(0,255)),int(random(0,255)),int(random(0,255)), 100); x[x.length-1] = 0; y[x.length-1] = height; } void draw() { background(226); reachSegment(0, mouseX, mouseY); for(int i=1; i=1; i--) { positionSegment(i, i-1); } for(int i=0; i