Draw your doodle in one stroke and the script will convert it in a set of sinusoids represented on your screen as moving circles.
let g,k,l,p,q,r,t=2,u=Math,v=u.PI,w=2*v;a.onmousedown=()=>{g=t=0;k=[];l=[];p=[]};a.onmouseup=()=>{t=1;let d=(d,b)=>b.a-d.a;q=y(l);r=y(p);q.sort(d);r.sort(d)};a.onmousemove=(d)=>{t||(l.push(d.pageX),p.push(d.pageY))};let z=(d,e)=>{let b=100,h=100;e.forEach((f)=>{let e=b,n=h,x=f.a;f=f.p+g*f.b+d;b+=x*u.cos(f);h+=x*u.sin(f);c.beginPath();c.arc(e,n,2*x,0,w);c.moveTo(e,n);c.moveTo(b,h);c.strokeStyle="#555";c.stroke()});return{x:b,y:h}},A=()=>{c.fillStyle="#000";c.fillRect(0,0,a.width,a.height);if(1===t){let d=z(0,q),e=z(v/2,r);k.push({x:d.x,y:e.y});c.beginPath();k.forEach((b,d)=>{let e=b.x;b=b.y;d?c.lineTo(e,b):c.moveTo(e,b)});c.strokeStyle="red";c.stroke();g+=w/r.length;g>w&&(g=0,k=[])}else 0===t&&(c.beginPath(), l.forEach((d,e)=>{var b=p[e];e?c.lineTo(d,b):c.moveTo(d,b)}),c.strokeStyle="red",c.stroke());requestAnimationFrame(A)},y=(d)=>{let e=d.length;return d.map((b,h)=>{let f=b=0;for(let m=0;m<e;m++){let n=2*v*h*m/e;b+=d[m]*u.cos(n);f-=d[m]*u.sin(n)}b/=e;f/=e;return{b:h,a:u.hypot(b,f),p:u.atan2(f,b)}})};A();
bGV0IGcsayxsLHAscSxyLHQ9Mix1PU1hdGgsdj11LlBJLHc9Mip2O2Eub25tb3VzZWRvd249KCk9PntnPXQ9MDtrPVtdO2w9W107cD1bXX07YS5vbm1vdXNldXA9KCk9Pnt0PTE7bGV0IGQ9KGQsYik9PmIuYS1kLmE7cT15KGwpO3I9eShwKTtxLnNvcnQoZCk7ci5zb3J0KGQpfTthLm9ubW91c2Vtb3ZlPShkKT0+e3R8fChsLnB1c2goZC5wYWdlWCkscC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