xxxxxxxxxx
31
function setup() {
randomSeed()
createCanvas(800, 800);
}
function draw(){
background("#22242A");
const N = 2900
const d = 10
const f = map(mouseX, 0, width, radians(137), radians(138)) // control angle with mouseX
const ampp = map(mouseY, 0, height, 0, 1)
// const f = radians(137.5) // golden angle
for(let i=0; i<N; i++){
x = ampp*i*cos(i*f) + width/2
y = ampp*i*sin(i*f) + height/2
noStroke()
fill(233, 30, 99, map(i, 0, N, 255, 0))
circle(x, y, map(i, 0, N, 1.5, 10))
}
fill(255)
stroke("rgba(66,66,66,0.4)")
strokeWeight(5)
textSize(20)
text("f = "+degrees(f), 10, 25)
text("a = "+ampp, 10, 45)
}