fractalkitty looking for math? fractalkitty.com

100 days of code

robinsEgg

#random#trig#animation#accumulates#math#parametric#nature

feather

k=1.5;
b=5;
function setup(){
  createCanvas(600,600);
  angleMode(DEGREES);
  noStroke()
  background(137, 45, 22)
  translate(width/2,height/2);
  strokeWeight(0.1)
  stroke(0,230,250);
}
function draw(){
  translate(width/2,height/2);
  push()
  translate(-200,0)
  feather();
  pop()
  push()
  translate(200,0)
  feather();
  pop()
  stroke(random(-20,20),230+random(-20,20),250+random(-20,20));
  t=100*sin(frameCount);
  r1=random(0,360)
  r2=random(0,360)
  x1=1/(2*sqrt(1+k*k))*((k*k-1)*b/k+(k*k+1)/k*sqrt(b*b-4*k*cos(r1)));
  x2=1/(2*sqrt(1+k*k))*((k*k-1)*b/k+(k*k+1)/k*sqrt(b*b-4*k*cos(r2)));
  y1=2*sin(r1)/(b+sqrt(b*b-4*k*cos(r1)));
  y2=2*sin(r2)/(b+sqrt(b*b-4*k*cos(r2)));

  line(490*y1,490*x1-2000,490*y2,490*x2-2000);
   
                        
}
function feather(){
  strokeWeight(2)
  r1=random(0,360);
  r2=random(0,360);
  x1=30*cos(r1);
  y1=150*sin(r1);
  strokeWeight(0.5);
  stroke(64+random(-20,20), 45+random(-20,20), 39+random(-20,20))
  line(x1,y1,0,y1+20)
  line(0,-150,0,250)
}