xxxxxxxxxx
38
var numberOfSeeds = 3000
var c = 1
// let coswave = [];
function setup() {
createCanvas(500, 500) //because i like phone backgrounds!
angleMode(DEGREES)
background('#FAF9F6')
translate(width/2,height/2);
// for (let i = 0; i < width; i++) {
// let amount = map(i, 0, width, 0, PI);
// coswave[i] = abs(cos(amount));
// }
// noLoop();
for(let i = 0; i < numberOfSeeds; i++) {
// golden ratio!
let angle = i * 100 // play here
let radius = c * sqrt(i)
// because computers (aka humans) work in the Cartesian plane
// when arranging their leaves or seeds or petals, plants seem to think in polar coordinates, that is, in terms of radius and angle
//here's how we translate between the two.
let x = radius * cos(angle) + width/200
let y = radius * sin(angle) + height/20
strokeWeight(.1);
// fill('gold')
// stroke('white')
line(x, y, 1, 1)
line(20+x, y, 1, 1)
// line(x+x, y+y, 1, 1)
// rotate(x)
}
}