xxxxxxxxxx
21
let r, phi;
let sc;
let z = 0;
function setup() {
sc = 4*width;
n = 1200;
phi = (1 + sqrt(5)) * PI
createCanvas(400, 400);
background(220);
}
function draw() {
if (frameCount <= n && (cos(frameCount * phi) < 0)) {
translate(width, height / 2);
let x = sc * sqrt(frameCount / n) * cos(frameCount * phi);
let y = sc * sqrt(frameCount / n) * sin(frameCount * phi);
line(x, y, 1.1 * x, 1.1 * y);
z++;
}
}