title: C++ angles, trigonometry
body: <p>I need some help calculating angles of points:
  <img src="https://i.stack.imgur.com/febuw.jpg" alt="enter image description here"></p>
  
  <p>I need to calculate angle from point (0,0) to points extracted from image. 1 would be 0*, 2 is about 40-44* etc.</p>
  
  <p>My problem is that atan2 shows incorrect values. 
  Current output of atan2 is:</p>
  
  <pre><code> 1:41.867535 2:64.653824 3:52.915009 4:30.375608 5:13.328092 
  </code></pre>
  
  <p>How can I calculate it from point 0,0? I can't use any non-standard libraries.</p>
  
  <p>I'm still doing something wrong. I'm trying:</p>
  
  <pre><code>   arrow1 = (M_PI - atan2(y, x) * (180 / M_PI);
  </code></pre>
  
  <p>Output: </p>
  
  <pre><code>   1: 131.867538  2: 154.653824  3: 142.915009  4: 120.375610  5: 103.328094 
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>   arrow1 = (M_PI - atan2(y, -x) * (180 / M_PI); 
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>    1: 48.132465  2: 25.346176  3: 37.084991  4: 59.624393  5: 76.671906 
  </code></pre>