Looping Lemniscate
A soothing shape of lemniscate looping in an organic manner is pure bliss to the eyes.
Now, you can just stay for a moment, calm yourself down and enjoy the beauty.
Code
elem = document.querySelector(".example-container");
setCanvas(elem);
t=0;
trail=[];
function draw() {
clearCanvas();
x=200*cos(t)/(1+sin(t)**2);
y=200*cos(t)*sin(t)/(1+sin(t)**2); //lemniscate equations
trail.push([WIDTH/2+x,HEIGHT/2-y]); //push the coordinates to the trail array
if(trail.length>100){
trail.shift();
}
for(let i=0;i<trail.length;i++){
new circle(trail[i][0],trail[i][1],10,'#695fe6',mapRange(i,0,100,0,1),'#fff0',0);
}
t+=0.018;
requestAnimationFrame(draw);
}
draw();