save
// math.js is included let m = math.parse('e^(-x^2)'); function f(x) { return m.eval({x:x}); } function loop(ctx, frame) { // coord_shift maps coordinate space to the canvas let coord_shift = drawFunction(ctx, f, -4, 4, { x_scale: 40, y_scale: 80, iter_size: 0.1 }); drawPoint(ctx, frame/10, f(frame/10), { shift: coord_shift, radius: 3, style: 'fill', color: 'green' }); }
frame rate
number of frames
height
width
convert to gif