Skip to content

Pattern

Posted on:October 8, 2022

Check out my work here

Black pattern on white background Black pattern on white background Black pattern on white background Black pattern on white background Black pattern on white background Black pattern on white background Black pattern on white background Black pattern on white background Black pattern on white background

function setup() {
  createCanvas(400, 400);
  background(255);
  noStroke();
  fill(0);
  let r1 = random(-1, 1);
  let r2 = random(-1, 1);
  let r3 = random(-1, 1);
  let r4 = random(-1, 1);
  for (let n = 0; n <= 50; n += 1) {
    let ang2 = map(n, 0, 50, 0, 2 * PI);
    for (let i = 0; i <= 100; i += 1) {
      let ang1 = map(i, 0, 100, 0, 2 * PI);
      circle(
        sin(ang1 * r1) * 150 * abs(cos(ang2 * r2)) + width / 2 + sin(ang2) * 25,
        cos(ang1 * r3) * 150 * abs(cos(ang2 * r4)) +
          height / 2 +
          sin(ang2) * 10,
        3 * abs(sin(ang2))
      );
    }
  }
  saveCanvas();
}