fractalkitty looking for math? fractalkitty.com

100 days of code

octahedralRave

#trig#animation#math

octoRave


let ax,ay,bx,by,cx,cy,fx,fy,gx,gy,hx,hy;
function setup(){
  createCanvas(600,600);
  stroke(255);
  background(0)
}
function draw(){
  background(0,0,0,5);
  translate(width/2,width/2);
  t=frameCount/70;
  rotate(t/20)
  stroke(200+55*sin(t),200+55*cos(t/2),200+55*cos(t));
  octoRave();
  
  
}

function octoRave(){
  ax=50*(sin(t))+50*cos(t/3)+20;
  ay=50*(cos(t))+50*sin(t);
  bx=-50*(sin(t))-100*cos(t)+10;
  by=50*(cos(t/2))+100*cos(t/2);
  cx=sin(t);
  cy=100*(cos(t/3))+100*sin(t/3);
  fx=200*(sin(t))*cos(t)-50*sin(t/2)+5;
  fy=200*(cos(t))+50*cos(t/2)-50*sin(t);
  gx=-150*(sin(t))-50*sin(t)-10;
  gy=150*(cos(t/2))-50*cos(t);
  hx=20*sin(t)-25*sin(t/3);
  hy=220*(cos(t))-100*cos(t)*sin(t)-50*cos(t/2);
  circle(ax,ay,10);
  circle(bx,by,10);
  circle(cx,cy,10);
  circle(fx,fy,10);
  circle(gx,gy,10);
  circle(hx,hy,10);
  line(ax,ay,bx,by);
  line(cx,cy,bx,by);
  line(ax,ay,cx,cy);
  line(gx,gy,fx,fy);
  line(hx,hy,fx,fy);
  line(hx,hy,gx,gy);
  line(ax,ay,fx,fy);
  line(cx,cy,fx,fy);
  line(ax,ay,hx,hy);
  line(bx,by,hx,hy);
  line(bx,by,gx,gy);
  line(cx,cy,gx,gy);
}