GeoDirection[{38,-76},{38,-75}]
(* 89.6922 Degrees *)
I am using version 12.0.0.
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityGeoDirection[{38,-76},{38,-75}]
(* 89.6922 Degrees *)
I am using version 12.0.0.
The expected answer from GeoDirection
will not be exactly 90 degrees for these inputs.
You are trying to find the direction between two points that lie on the same line of latitude. And the 38th line of latitude does run due east from 38°N 76°W and intersects 38°N 75°W.
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:
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.
$\endgroup$
Nov 23, 2021 at 0:00
GeoDirection[{38, -76}, {38, -76 + 0.001}]
andGeoDirection[{38, -76}, {38, -76 + 180}]
. In the first case, the limit goes to90 Degrees
, and in the second case, it is0 Degrees
. Perhaps this sketch (!!) is of use. $\endgroup$