Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There is a common formula for computing the initial bearing for a course from lat1, lon1 to lat2, lon2. (And yes, I'm aware that the course will change when traveling).

atan2( sin(lon2-lon1) * cos(lat2), cos(lat1)*sin(lat2)-sin(lat1)*cos(lat2)*cos(lon2-lon1))

The formulary where I took this from mostly uses a spherical model for simplicity.

My questions about this formula are:

  1. What is the appropriate formula for an ellipsoid model such as WGS84?

  2. If it is the same formula, does this hold generally? I.e. is it the same formula for any ellipsoid model because we deformed the coordinate system, not the coordinates?

Somewhat like Vincentry's formula, which uses a reduced latitude u = atan((1 - f) * tan(lat)). Also note that I'm looking for a global solution, including for the poles.

share|improve this question
Your second question is answered in many places here; answers for both the sphere and ellipsoid appear at The first question perhaps is most easily answered in many practical cases by first applying the ellipsoidal Mercator projection and measuring the bearing in projected coordinates; this will fail in polar regions. – whuber Mar 14 '13 at 16:18
Thank you. The arxiv reference in that question is helpful. (I removed that part of the question again, as it is redundant.) – Erich Schubert Mar 14 '13 at 16:38
The suggestion in part 2 is clever but, unfortunately, incorrect. Geodesics on ellipsoids are complicated. For example, on the sphere, all geodesics emanating from a point meet again at a common location (diametrically opposite their start). That's not so at generic points on ellipsoids! For a tiny bit of insight into this, please see my account of Clairaut's Theorem at…. – whuber Mar 14 '13 at 16:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.