日常の進捗

主に自分のための,行為とその習慣化の記録

ランダムな点を線でつなぐ

fullScreen();
colorMode(HSB,360,100,100);
background(330, 80, 40);
stroke(0, 0, 100);
PVector[] points = new PVector[1000];
for (int i = 0; i < 1000; i++) {
  points[i] = new PVector(random(width), random(height));
}
for (PVector p1 : points) {
  for (PVector p2 : points) {
    if (!p1.equals(p2) && p1.dist(p2) < 50) {
      line(p1.x, p1.y, p2.x, p2.y);
    }
  }
}