title: Math Calculation to retrieve angle between two points?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7586063/how-to-calculate-the-angle-between-two-points-relative-to-the-horizontal-axis">How to calculate the angle between two points relative to the horizontal axis?</a>  </p>
  </blockquote>
  
  
  
  <p>I've been looking for this for ages and it's just really annoying me so I've decided to just ask...</p>
  
  <p>Provided I have two points (namely x1, y1, and x2, y2), I would like to calculate the angle between these two points, presuming that when y1 == y2 and x1 > x2 the angle is 180 degrees...</p>
  
  <p>I have the below code that I have been working with (using knowledge from high school) and I just can't seem to produce the desired result.</p>
  
  <pre><code>float xDiff = x1 - x2;
  float yDiff = y1 - y2;
  return (float)Math.Atan2(yDiff, xDiff) * (float)(180 / Math.PI);
  </code></pre>
  
  <p>Thanks in advance, I'm getting so frustrated...</p>