Sistemas Físicos Interactivos 2
Animación de: https://x.com/yuruyurau
Cómo esta hecha esta Animación
Sección titulada «Cómo esta hecha esta Animación»Puedes experimentar aquí.
/* Este código es una versión más legible del trabajo original:https://x.com/yuruyurau*/
let t = 0;
function setup() { createCanvas(400, 400); background(9); colorMode(HSB, 360, 100, 100);}
function draw() { background(9);
t += PI / 45; for (let i = 10000; i--;) { let x = i % 200; let y = i / 55;
let k = 9 * cos(x / 8); let e = y / 8 - 12.5; let d = sq(mag(k, e)) / 99 + sin(t) / 6 + 0.5;
let angle = atan2(k, e); let q = 99 - e * sin(angle * 7) / d + k * (3 + cos(d * d - t) * 2); let c = d / 2 + e / 69 - t / 16;
let px = q * sin(c) + 200; let py = (q + 19 * d) * cos(c) + 200;
stroke(map(mouseX, 0, width, 0, 360), 100, 100, 0.5); point(px, py); }}
function keyPressed(){ console.log(frameRate());}