title: Shortest way to turn towards a target?
body: <p>Ive created a small tank-shooter-minigame, and is currently working on cpu control of other tanks.</p>
  
  <p>A cpu tank knows the following:</p>
  
  <ul>
  <li>Its own facing, the direction its facing</li>
  <li>Its own position (X and Y)</li>
  <li>Its targets position (X and Y)</li>
  </ul>
  
  <p>On top of that ive made it so that positive y is downwards instead of upwards. positive x direction is left to right.</p>
  
  <p>How do i calculate the shortest way the cpu tank need to rotate to point on its target?</p>
  
  <p>Lets say tank is at (3,3), facing 90 degrees (straight left) and Im at (4,7). What would the calucations be?</p>