xxxxxxxxxx
function easeOutElastic(x) {
const c4 = (2 * Math.PI) / 3;
return x === 0
? 0
: x === 1
? 1
: pow(2, -10 * x) * sin((x * 10 - 0.75) * c4) + 1;
}
function setup() {
createCanvas(windowWidth, windowHeight);
background(100);
}
function draw() {
background(0);
translate(width/2,height/2);
for(let i = 0 ; i<20; i++){
push();
rotate(2*PI/20*i);
let ratio = map((frameCount*5 + i * 2)%width,0,width,0,1);
let result = easeOutElastic(ratio);
ellipse(0, 200*result, 100);
pop();
}
// ellipse(mouseX, mouseY, 20, 20);
}