Circle Of Circles


  size(200,200);
  smooth();
  background(255);
  
  int nbr_circles = 24;
  
  float lg_diam = width * .85;
  float lg_rad = lg_diam / 2;
  float lg_circ = PI * lg_diam;
  
  float sm_diam = (lg_circ / nbr_circles);
  
  float cx = width/2.0;
  float cy = height/2.0;
  
  fill(0);
  for (int i = 1; i <= nbr_circles; ++i) {
    float angle = i * TWO_PI / nbr_circles;
    float x = cx + cos(angle) * lg_rad;
    float y = cy + sin(angle) * lg_rad;
    ellipse(x, y, sm_diam, sm_diam);
  }