fractalkitty looking for math? fractalkitty.com

100 days of code

fishCurve

#trig#animation#math#parametric

dEllipsedTalbot

let a=250;p=1
function setup() {
  createCanvas(800, 600);
  background(0,0,90)
  stroke(255)
  strokeWeight(0.02)
  noFill()
}

function draw() {
  translate(width/2,height/2)
  background(0,0,50,5);
  if (frameCount%2==0){p=p+1}
  t=frameCount
  angleMode(DEGREES)
  stroke(255-50*sin(p),255-30*cos(p),250+5*sin(p))
  noFill()
  push()
  translate(-197,0)
  dTalbot(a*2.51,RADIANS)
  pop()
  dTalbot(a)
  push()
  translate(79,0)
  dTalbot(a/2.54,RADIANS)
  pop()
  push()
  translate(110,0)
  dTalbot(a/6.32,RADIANS)
  pop()
  push()
  translate(122,0)
  dTalbot(a/16.7,RADIANS)
  pop()
  push()
  translate(127,0)
  dTalbot(a/46,RADIANS)
  pop()
  print(p)
  if (p==720){p=1;background(0,0,90)}
}

function dEllipse(a,b){
  angleMode(DEGREES)
  beginShape()
  for(let i=0;i<=360-1;i++){
    vertex(a*cos(i),a*sin(i)/sqrt(2))
  }
  endShape(CLOSE)
}

function dTalbot(a1,aMode){
  angleMode(aMode)
  beginShape()
  for(let i=0;i<=p-3;i++){
    x=a1*cos(i)-a1*sin(i)*sin(i)/sqrt(2);
    y=a1*cos(i)*sin(i)
    vertex(x,y);
  }
  endShape(CLOSE)
}