fractalkitty looking for math? fractalkitty.com

Coded Poems

inner sketch

#random#trig#interactive#poem#math#polar

Haiku pairing is here:

playB


let r,a=3,b=2,c=4
let cnt=0
let playB = true;
function setup() {
  cnv = createCanvas(windowWidth,windowHeight);
  noFill()
  angleMode(DEGREES)
  strokeWeight(0.05)
  r=80;
}

function draw() {
  translate(width/2,height/2);
  stroke(0,0,0,20)
  strokeWeight(0.2)
    for(let j=0;j<20;j++){
    for(let i=0;i<=360;i+=0.5){
      x1=r*sin(i*c)
    y1=r*cos(i*c)
    x2=r*2*sin(i*a);
    y2=r*2*cos(i*a)
    x3=r*3*sin(i*b);
    y3= -r*3*cos(i*b)
    triangle(x1,y1,x2,y2,x3,y3)
    }
  
    frameCount=0;
    background(255,255,255,3)
    a=int(random(-20,20));
    b=int(random(-20,20));
    c=int(random(1,12));
    r=int(random(10,width/3))
    }
  noLoop()
}

function mousePressed(){
  background(255)
  a=int(random(-20,20));
    b=int(random(-20,20));
    c=int(random(1,12));
    r=int(random(10,150))
  loop()
  
}

function keyPressed(){
  playB=!playB 
  if(keyCode===83){
    save(cnv,"innersketch",'png')
  }
}