title: Determine compass direction from one lat/lon to the other
body: <p>Does anyone have an algorithm to determine the direction from one lat/lon to another (pseudo-code): </p>
  
  <pre><code>CalculateHeading( lat1, lon1, lat2, long2 ) returns string heading
  </code></pre>
  
  <p>Where heading is e.g. NW, SW, E, etc.</p>
  
  <p>Basically, I have two points on a map and I want to get a general idea of the direction taking into account that 50 miles East and one mile North is simply East and not Northeast.</p>