function setup() {
createCanvas(windowWidth, windowHeight);
angleMode(DEGREES);
noFill();
strokeWeight(10);
stroke(0, 200, 200);
}
function draw() {
background(255, 255, 255, 50);
translate(width / 2, height / 2);
t = frameCount / 20;
for (let i = 1; i < 10; i++) {
push();
rotate(i * 60+t*i);
scale((10 / (i * i)) , (10 / (i * i)) );
shannon();
pop();
}
background(255,255,255,150)
shannon()
}
function addArc(x0, y0, r, a0, a) {
beginShape();
for (let i = 0; i < 1; i = i + 0.01) {
xc = x0 - sin(a0);
yc = y0 - cos(a0);
x = xc + r * cos(a0 + a * i);
y = yc + r * sin(a0 + a * i);
vertex(x, y);
}
endShape();
}
function shannon() {
stroke(96, 122, 148);
addArc(0, 0, 100, 0, 120);
stroke(39, 76, 112);
line(100, 0, cos(120) * 100, 100 * sin(120));
stroke(145, 176, 207);
addArc(-cos(120) * 100, 100 * sin(120), 100, 300, 240);
stroke(87, 78, 122);
addArc(0, 0, 100, 120, 120);
stroke(161, 153, 196);
addArc(-sin(120) * 100 - 10, 0, 100, 60, 240);
stroke(48, 39, 84);
line(cos(120) * 100, -100 * sin(120), cos(120) * 100, 100 * sin(120));
stroke(114, 150, 145);
addArc(0, 0, 100, 240, 120);
stroke(157, 204, 197);
addArc(-cos(120) * 100, -100 * sin(120), 100, 180, 240);
stroke(53, 82, 78);
line(100, 0, cos(120) * 100, -100 * sin(120));
stroke(255);
circle(100, 0, 10);
circle(cos(120) * 100, -100 * sin(120), 10);
circle(cos(120) * 100, 100 * sin(120), 10);
}