You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
545 B
29 lines
545 B
const deg = Math.PI/180;
|
|
const ma = (1+Math.sqrt(5))/2;
|
|
const c = 2;
|
|
let n = 1;
|
|
|
|
function setup() {
|
|
createCanvas(360,360);
|
|
noStroke();
|
|
frameRate(32);
|
|
colorMode(HSB);
|
|
}
|
|
|
|
function draw() {
|
|
background(64);
|
|
|
|
translate(width/2, height/2);
|
|
scale(width/5/sqrt(n), height/5/sqrt(n));
|
|
for (i = 0; i<=n; i++){
|
|
let a = i*ma;
|
|
let r = c * sqrt(i);
|
|
let x = r * cos(a);
|
|
let y = r * sin(a);
|
|
fill(floor(i/4), 255, 255);
|
|
circle(x, y, 2);
|
|
}
|
|
if(n >= 1024)
|
|
noLoop();
|
|
n++;
|
|
}
|
|
|