fractalkitty looking for math? fractalkitty.com

Genuary 2022

10000 Steps of a Sandhill Crane_SmallSize

#trig#spiral#animals#genuary

10000 Steps of a Sandhill Crane

footprintsignature

let s = -1;
function setup() {
  createCanvas(2000, 2000);
  background(255, 230, 180);
  angleMode(DEGREES);
  noLoop();
}

function draw() {
  scale(0.3, 0.3);
  scale(0.9, 0.9);
  translate(width / 2 + 110, height / 2 + 110);
  background(255, 230, 180);
  fill(28, 80, 112, 165);
  stroke(28, 80, 112);
  beginShape();
  for (let i = -width / 2; i <= width / 2; i = i + 10) {
    x =
      200 * cos(frameCount + i / 3) -
      150 * sin(frameCount - i / 2) * cos(i / 4) +
      130 * sin(frameCount + i / 8);
    vertex(x, i);
  }
  vertex(height / 2, width / 2);
  vertex(-height / 2, width / 2);
  vertex(-height / 2, -width / 2);
  endShape(CLOSE);
  r = width / 35;
  for (let i = 1; i < 10000; i++) {
    t = i * 3;
    x = r * sin(t * 137.5);
    y = r * cos(t * 137.5);
    s = s * -1;
    push();
    rotate(r + t / 500);
    push();
    translate(x + s * 15 * sin(t), y + 15 * s * cos(t));
    rotate(90 - t * 137.5);
    scale(0.1 + (0.01 * r) / (width / 35), 0.1 + (0.01 * r) / (width / 35));
    footprint();
    pop();
    pop();
    if (t % 180 === 0) {
      r += 6;
    }
  }
  rect(-width / 2, -height / 2, width, 10);
  rect(-width / 2, -height / 2, 10, height);
  rect(-width / 2, height / 2 - 10, width, 10);
  rect(width / 2 - 10, -height / 2, 10, height);
  rect(-width / 2 - width * 0.05, -height / 2 - height * 0.05, width * 1.1, 20);
  rect(
    -width / 2 - width * 0.05,
    -height / 2 - height * 0.05,
    20,
    height * 1.1
  );
  rect(
    -width / 2 - width * 0.05,
    height / 2 + height * 0.05 - 20,
    width * 1.1,
    20
  );
  rect(
    width / 2 + width * 0.05 - 20,
    -height / 2 - height * 0.05,
    20,
    height * 1.1
  );

  push();
  translate(width / 2 - 50, height / 2 - 50);
  scale(-1, 1);
  rotate(-20);
  signature();
  pop();
  scale(1, 1);
  footprint();
  noLoop();
}

function footprint() {
  fill(8, 50, 72);
  ellipse(0, -10, 5, 50);
  push();
  rotate(30);
  ellipse(18, 0, 5, 50);
  pop();
  push();
  rotate(-30);
  ellipse(-18, 0, 5, 50);
  pop();
}

function signature() {
  noFill();
  strokeWeight(2);
  stroke(8, 50, 72);
  beginShape();
  for (let i = 400; i > -10; i--) {
    y = i / 15;
    x = 10 * sin(i);
    vertex(x, y);
  }
  endShape();
  circle(-18, 18, 1);
}