x is analogous to frameCount (grows +1).
algos applied to y in each sketch,
are normalized (0, 1), ie. .5 is height/2.
hover sketch to loop. click to reset.
select algos to edit / copy + paste
p5.js math reference:
// wave example for p5.js
let w = width, h = height;
let xpos = frameCount % w;
let x = xpos*.2; // adjust speed
let y = _insert_algo_;
ellipse(xpos, h/2 + y*h, 50);
// shape example for p5.js
let w = width, h = height;
let xpos = frameCount % w;
let x = xpos * .2;
let y = _insert_algo_;
let xshape = w/2 + cos(x*.1)*w/2;
ellipse(xshape, h/2 + y*h, 50);