title: Finding angles of dots to make a mechanical wave effect
body: <p>This is just only for fun.</p>
  
  <p>I want to know the formula of getting the <strong>angle</strong> of each one of those dots rotating in their corresponding circles.</p>
  
  <p>These are my given values:</p>
  
  <ul>
  <li>number of rows</li>
  <li>number of columns</li>
  <li>radius of their circle(universal)</li>
  </ul>
  
  <p>And this is the picture I want to achieve:</p>
  
  <p><img src="https://i.stack.imgur.com/P6dbx.gif" alt="enter image description here"></p>
  
  <p>I assume that the speed of rotation of each dots are uniform</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Yayks! Thanks for all your answers. However, I manage to make my own too but in different pattern:</p>
  
  <p><img src="https://i.stack.imgur.com/70d8p.gif" alt="enter image description here"></p>
  
  <p>By doing the logic only in the constructor side:</p>
  
  <pre><code>CircleWithDots() : timer(clock()), angle(angle_counter = (angle_counter &gt;= REVOLUTION - 1) ? 0 : angle_counter + ANGLE_STEP) { }
  </code></pre>
  
  <p>Where:</p>
  
  <pre><code>REVOLUTION = 360 + 1;
  ANGLE_STEP = 20;
  </code></pre>
  
  <p>And also this one (for rotating dot):</p>
  
  <pre><code>x = table_cos[angle] * radius;
  y = -table_sin[angle] * radius;
  </code></pre>