PVector acr1, acr2, ctl1, ctl2;
PVector itp, itpCtl1, itpCtl2;
PVector dir = PVector.random2D();
acr1 = PVector.mult(dir, 200);
acr2 = PVector.mult(PVector.mult(dir, -1), 200);
ctl1 = PVector.add(acr1, PVector.mult(PVector.random2D(), 100));
ctl2 = PVector.add(acr2, PVector.mult(PVector.random2D(), 100));
itpCtl1 = new PVector(0, 0);
itpCtl2 = new PVector(0, 0);
itp.set(bezierPoint(acr1.x, ctl1.x, ctl2.x, acr2.x, ratio),
bezierPoint(acr1.y, ctl1.y, ctl2.y, acr2.y, ratio));
itpCtl1.set(lerp(acr1.x, ctl1.x, ratio),
lerp(acr1.y, ctl1.y, ratio));
itpCtl2.set(lerp(itpCtl1.x, lerp(ctl1.x, ctl2.x, ratio), ratio),
lerp(itpCtl1.y, lerp(ctl1.y, ctl2.y, ratio), ratio));
bezier(itp.x, itp.y, itpCtl2.x, itpCtl2.y, itpCtl1.x, itpCtl1.y, acr1.x, acr1.y);
line(ctl1.x, ctl1.y, acr1.x, acr1.y);
line(ctl2.x, ctl2.y, acr2.x, acr2.y);
bezier(acr1.x, acr1.y, ctl1.x, ctl1.y, ctl2.x, ctl2.y, acr2.x, acr2.y);
ratio = float(mouseX)/width;
translate(width*.5, height*.5);