/** multiple curves between to points by Guru */ void setup() { size(300,300); smooth(); noLoop(); } void draw() { background(255); stroke(120); strokeWeight(0.1); for( int i =0; i < 50; i++ ) { drawCurve( 150, 40, true, false, 50, 250 ); } for( int i =0; i < 50; i++ ) { drawCurve( 200, 40, false, true, 200, 250 ); } } void drawCurve( int x1, int y1, boolean p1, boolean p2 , int x2, int y2 ) { noFill(); beginShape(); curveVertex( x1, y1 ); curveVertex( x1, y1 ); float dx = x2 - x1; float dy = y2 - y1; float d = sqrt( dx*dx + dy *dy); int fact1 = (p1 ? +1 : -1 ); float ax = x1 + dx/(p2?5:2) + fact1 * (d/3* -dy/ d) + fact1 * random( d / 10); float ay = y1 + dy/(p2?5:2) + fact1 * (d/3* dx / d) + fact1 * random( d / 10); curveVertex( ax,ay ); if (p2 ) { int fact2 = (p1 ? -1 : +1 ); float bx = x1 + 4*dx/5 + fact2 * (d/3*-dy/d) + fact2 * random(d / 10); float by = y1 + 4*dy/5 + fact2 * (d/3*dx/d) + fact2 * random(d / 10); curveVertex( bx,by ); } curveVertex( x2, y2 ); curveVertex( x2, y2 ); endShape(); }