constbgCol="#447abd";constgCol="#a2c2e8";constnGrid=20;letw;letgSpace;functionsetup(){w=max(500,min(windowWidth,windowHeight)*0.9);createCanvas(w,w);describe("lines making a frame through changing slope and animating inward with an identical frame rotating in the center - as they get closer a circle almost forms. This is in a blueprint design. ");rectMode(CENTER);angleMode(DEGREES);textSize(16);}functiondraw(){background(bgCol);translate(w/2,w/2);drawGrid();t=frameCount/3;stroke(255);strokeWeight(1);push();translate(-w/2+gSpace,-w/2+gSpace);standardForm();pop();push();rotate(t/2);scale(0.5,0.5);translate(-w/2,-w/2);standardForm();pop();noStroke();fill(bgCol);rect(0,-w/2+gSpace/2,w,gSpace);rect(-w/2+gSpace/2,0,gSpace,w);rect(0,w/2-gSpace/2,w,gSpace);rect(w/2-gSpace/2,0,gSpace,w);fill(gCol);text("form",-w/2+10,w/2-10);}functiondrawGrid(){gSpace=(w/nGrid)*0.95;stroke(gCol);strokeWeight(0.3);for(leti=1;i<=nGrid;i++){for(letj=1;j<=nGrid;j++){line(-w/2+gSpace*i,-w/2+gSpace,-w/2+gSpace*i,w/2-gSpace);line(-w/2+gSpace,-w/2+gSpace*i,w/2-gSpace,-w/2+gSpace*i);}}noFill();strokeWeight(3);rect(0,0,w-2*gSpace);}functionstandardForm(){for(leti=1;i<nGrid;i++){A=i;B=nGrid-i;C=B*A*abs(sin(t));x1=0;y1=(-B/A)*x1+C/A;x2=A;y2=(-B/A)*x2+C/A;line(x1*gSpace,y1*gSpace,x2*gSpace,y2*gSpace);push();translate(w-gSpace*2,0);scale(-1,1);line(x1*gSpace,y1*gSpace,x2*gSpace,y2*gSpace);pop();push();translate(0,w-gSpace*2);scale(1,-1);line(x1*gSpace,y1*gSpace,x2*gSpace,y2*gSpace);push();translate(w-gSpace*2,0);scale(-1,1);line(x1*gSpace,y1*gSpace,x2*gSpace,y2*gSpace);pop();pop();}}functionmousePressed(){setup();draw();}functionwindowResized(){setup();draw();}