xxxxxxxxxx
// engineer: jWilliam Dunn
// 2023.1109
let g,a=0;
const phi=(1+Math.sqrt(5))/2; //golden ratio
function ge(t) {
return Math.pow(t,phi);
}
var in_out=(t,f) => (t<0.5) ? f(t*2.0)*0.5 : (1.0-f((1.0-t)*2.0))*0.5+0.5;
function setup() {
createCanvas(510,510);
noStroke();
fill(224,165,38); //goldenrod color
g=PI*(3.0-sqrt(5.0)); //golden angle
frameRate(30);
}
function draw(){
background(0);
translate(width/2,height/2);
scale(phi);
for(let i=0;i<300;i++){
push();translate(i*0.5,0);rotate(in_out(a/100.0,ge)*PI/2+g);
rect(-(3.7+i*0.05)/2.0,-(3.7+i*0.05)/2.0, 3.7+i*0.05,3.7+i*0.05); pop();
rotate(g);
}
a++;
a=a%100;
}