fractalkitty looking for math? fractalkitty.com

Mathober 2025

Deviation

#random#trig#animation#math#polar#mathober

let t = 0;
function setup() {
  createCanvas(500, 500);
  background(255);
  describe(
    "A dark circle with longitudinal lines being drawn with random dots lighter dots on a peice of circular graph paper and staticky specles around the circle giving a feeling of orbits. "
  );
  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, 20);
  fill(75, 85, 95);
  circle(0, 0, width / 3);
  noFill();
  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 < 50; j++) {
    x = random(width / 6 - 50, width / 6 + 50);
    theta = random(0, 2 * PI);
    circle(x * cos(theta), x * sin(theta), random(1, 4));
  }
  noFill();

  for (let i = 0; i < 6; i++) {
    push();
    let a = random(-2, 2);
    for (let j = 0; j < 100; j++) {
      fill(200 - i * 15 + a, 210 - i * 15 + a, 220 - i * 15 + a, 40);
      stroke(200 - i * 15 + a, 210 - i * 15 + a, 220 - i * 15 + a, 40);
      x = random(width / 6 - 1.5, width / 6 + 1.5);
      y = (i * width) / 3 / 2 / 6;
      theta = random(0, 2 * PI);
      ellipse(y * cos(theta), x * sin(theta), random(0.5, 2));
    }
    pop();
  }
}