So you want to draw a line with a jitter?
Try to draw a bunch of consecutive Bezier curves, while all parts of the Y axis point are evenly distributed and randomize the x values โโby a certain amount.
Here is an example to get you started:
var can = document.getElementById('canvas1'); var ctx = can.getContext('2d'); function addJitteryBezier(fromx, fromy, tox, toy) { var diffx = tox - fromx; var diffy = toy - fromy; var neg = Math.random()*diffy/5;
<canvas id="canvas1" width="500" height="500"></canvas>
http://jsfiddle.net/GfGVE/9/
Simon sarris
source share