fractalkitty looking for math? fractalkitty.com

all

Link

#random#trig#animation#math#mathober

let t = 0;
function setup() {
  createCanvas(500, 500);
  background(255);
  describe(
    "Six rings in a circle with a single link holding them together in the middle - there are gradient colors for each ring all in a slate-gray color. there are radial gridlines in the background and static feels in the sketch."
  );
  noFill();
  rectMode(CENTER);
}

function draw() {
  background(245, 250, 255, 30);
  t += 0.01;
  translate(width / 2, height / 2);
  n = 25;
  d = width / n;
  stroke(100, 110, 120, 10);
  for (let i = 0; i < n; i++) {
    push();
    rotate(((2 * PI) / n) * i);
    strokeWeight(0.5);
    line(-width / 1.5, 0, width / 1.5, 0);

    circle(0, 0, (width / n) * 2 * i);
    pop();
  }

  for (let i = 0; i < 1000; i++) {
    push();
    strokeWeight(1);
    stroke(245, 250, 255);
    fill(245, 250, 255);
    x = random(-width / 2, width / 2);
    y = random(-width / 2, width / 2);
    circle(x, y, 1);
    pop();
  }

  stroke(75, 85, 95);

  circle(0, 0, width / 3);

  strokeWeight(1);
  stroke(100, 110, 120, 30);
  rect(0, 0, width / 1.02, width / 1.02);
  rect(0, 0, width / 1.04, width / 1.04);
  fill(75, 85, 95);
  for (let j = 0; j < 100; j++) {
    x = random(width / 6 - 7.5, width / 6 + 7.5);
    theta = random(0, 2 * PI);
    circle(x * cos(theta), x * sin(theta), random(1, 4));
  }
  noFill();

  for (let i = 0; i < 6; i++) {
    strokeWeight(1);
    stroke(200 - i * 15, 210 - i * 15, 220 - i * 15);
    push();

    translate(
      (width / 15) * cos((i * PI) / 3) + (width / 6) * cos((i * PI) / 3),
      (width / 15) * sin((i * PI) / 3) + (width / 6) * sin((i * PI) / 3)
    );
    let a = random(-20, 20);
    for (let j = 0; j < 100; j++) {
      fill(200 - i * 15 + a, 210 - i * 15 + a, 220 - i * 15 + a);
      stroke(200 - i * 15 + a, 210 - i * 15 + a, 220 - i * 15 + a);
      x = random(width / 6 - 7.5, width / 6 + 7.5);
      theta = random(0, 2 * PI);
      circle(x * cos(theta), x * sin(theta), random(1, 4));
    }
    pop();

    strokeWeight(15);

    circle(
      (width / 15) * cos((i * PI) / 3) + (width / 6) * cos((i * PI) / 3),
      (width / 15) * sin((i * PI) / 3) + (width / 6) * sin((i * PI) / 3),
      width / 3
    );
  }
  i = 0;
  stroke(200 - i * 15, 210 - i * 15, 220 - i * 15);
  arc(
    (width / 15) * cos((i * PI) / 3) + (width / 6) * cos((i * PI) / 3),
    (width / 15) * sin((i * PI) / 3) + (width / 6) * sin((i * PI) / 3),
    width / 3,
    width / 3,
    PI,
    2 * PI
  );
  for (let i = 0; i < 6; i++) {
    stroke(75, 85, 95);
    arc(
      0,
      0,
      width / 3,
      width / 3,
      (2.7 * PI) / 2 + (i * PI) / 3,
      TWO_PI - PI / 2 + (i * PI) / 3
    );
  }
}