# Do you agree GeoDirection should return 90 degrees in this example?

GeoDirection[{38,-76},{38,-75}]
(* 89.6922 Degrees *)


I am using version 12.0.0.

• Try GeoDirection[{38, -76}, {38, -76 + 0.001}] and GeoDirection[{38, -76}, {38, -76 + 180}]. In the first case, the limit goes to 90 Degrees, and in the second case, it is 0 Degrees. Perhaps this sketch (!!) is of use. Nov 22, 2021 at 22:11

The expected answer from GeoDirection will not be exactly 90 degrees for these inputs.
But GeoDirection finds the heading of a geodesic ("great circle") route between the two given points, and lines of latitude are not great circles on Earth's surface. So there is a discrepancy between the line-of-latitude path and the great-circle path, explaining why the initial heading given by GeoDirection is a tiny bit north of east.
If I've done my spherical trigonometry correctly, then for two points at latitude $$\lambda$$ separated by a longitude $$\Delta \phi$$, the initial heading $$\alpha$$ between the two points will be given by $$\cot \alpha = \sin \lambda \tan \frac{\Delta \phi}{2}.$$ Plugging in the numbers $$\lambda = 38°$$ and $$\Delta \phi = 1°$$ gives the same result as Mathematica. We also see that:
• As $$\Delta \phi \to 0$$, the right-hand side goes to zero regardless of $$\lambda$$, and so $$\alpha \to 90°$$. Thus, for small changes in longitude, the heading approaches due east.
• Similarly, for $$\lambda = 0$$, $$\alpha = 90°$$ regardless of $$\Delta \phi$$. This is because the line of 0° latitude is the Equator, which is a great circle on the Earth's surface.
• The default datum assumes an ellipsoidal earth. But if you assume a spherical earth then you get exactly the same angle calculated here. In[24]:= 180/Pi*ArcCot[Sin[38 Degree] Tan[1 Degree/2]] - QuantityMagnitude[GeoDirection[GeoPosition[{38, -76}, "SphericalEarth"], GeoPosition[{38, -75}, "SphericalEarth"]]] Out[24]= 0. Nov 23, 2021 at 0:00