fractalkitty looking for math? fractalkitty.com

100 days of code

blooming_day29

#trig#animation#polar#plants

let r=150,
    n=19
function setup() {
  createCanvas(500, 500);
  noFill()
  angleMode(DEGREES)
}

function draw() {
  background(255);
  fill(200,120,10,30)
  translate(width/2,width/2);
  scale(1,-1);
  t = frameCount*2
  for(let i =0;i<n;i++){
  push()
    rotate(i*360/n)
    circle(r,r/1.5,r+50*sin(t/5))
    fill(250,220,10,10)
    circle(1.1*r,1.2*r,r+300*cos(t/10)*cos(t/10))
    fill(200,120,100,20)
    circle(r/2,r/2,r)
    fill(100,20,10,20)
    circle(r/2,0,r+200*sin(t/10)*sin(t/10))
    fill(200,50,10,20)
    circle(r/2,r*1.2,2*r+100*sin(t/10)*sin(t/10))
  pop()  
    
}
  for (let i=0;i<n;i++){
    noStroke()
    fill(255,255,255,4)
    circle(width/2*sin(360/n*i),width/2*cos(360/n*i),width)
  }
}