xxxxxxxxxx
32
function setup() {
createCanvas(400, 400);
background(220);
const c45 = cos(PI/4);
function sq(x,y,r,c = 0,s = 0.7,wgt = 3, col = color(244,96,54)) {
strokeWeight(wgt);
stroke(col);
noFill();
const wdt = c45 * r * 2;
const wdt2 = wdt * 0.5;
square(x - wdt2, y - wdt2, wdt);
if(c > 0) {
cc(x,y,wdt,c-1, s, wgt * s);
}
}
function cc(x,y,d,c = 0, s = 0.7,wgt = 3, col = color(244,96,54)) {
strokeWeight(wgt);
stroke(col);
noFill();
circle(x,y,d);
if(c > 0) {
sq(x,y,d/2,c-1, s, wgt * s);
}
}
//sq(200,200,200,30,0.9);
cc(200,200,400,30,0.9);
}
function draw() {
}