title: Cocos2d angle confusion
body: <p>This system is really confusing me. I'm rotating a turret to face an enemy sprite, I get the angle in radians with:</p>
  
  <pre><code>float angleRadians = atanf(yDifference / xDifference);
  float angleDegrees = CC_RADIANS_TO_DEGREES(angleRadians);
  </code></pre>
  
  <p>That's cool, now I put the enemy in several positions to see how it plotted the angles in DEGREES:</p>
  
  <p>T = Turret</p>
  
  <pre><code>-45      90      45
  
  -0        T       0
  
  45       -90     -45
  </code></pre>
  
  <p>The angle for an enemy top-right of the turret is going to be the same as the angle for an enemy bottom-left, thus I'd have to have some form of condition to distinguish the 2. That wouldn't be hard except for the fact that cocos2d's rotational angles work like this:</p>
  
  <pre><code>45      90        135
  
  0       T       +/-180
  
  -45    -90       -135 
  </code></pre>
  
  <p>What do I have to do to convert the angle I calculated at the start to correctly rotate the turret with this system above? </p>