Spherical trigonometry (source code)

= Spherical trigonometry
{wiki}

<Spherical trigonometry> calculates the sides and interior <angles> of <spherical triangles> using <trigonometric functions>. Its sides must be shorter <great circle> arcs, which are <geodesics> on a round <sphere>. A curve at constant nonzero <latitude> does not qualify. The <spherical law of sines> and <spherical law of cosines> play the roles of the familiar flat-triangle rules, but account for the <sphere>'s <curvature>.

Use uppercase $A,B,C$ both for the vertices and for their interior <angles>, and lowercase $a,b,c$ for the opposite angular sides. For example, $a$ is the central <angle> subtended by the arc from $B$ to $C$. On a <sphere> of <radius> $R$, its physical <arc length> is $\ell_a=Ra$ when $a$ is in <radians>; similarly $\ell_b=Rb$ and $\ell_c=Rc$. Only on the <unit sphere> do the angular and physical side <lengths> have the same numerical values. See https://www.astro.uvic.ca/~tatum/celmechs/celm3.pdf[J. B. Tatum, Celestial Mechanics, chapter 3, section 3.5: great-circle sides and angular units].

One useful application of <spherical trigonometry> is finding <great-circle distance> from <spherical coordinates>. Write a <unit vector> as $u(\phi,\lambda)=(\cos\phi\cos\lambda,\cos\phi\sin\lambda,\sin\phi)$, where $\phi$ is <latitude> and $\lambda$ is the equatorial <azimuth>, or longitude, measured from a chosen reference direction. The <dot product> of two such <unit vectors> gives
$$
\cos\delta=\sin\phi_1\sin\phi_2+\cos\phi_1\cos\phi_2\cos(\lambda_2-\lambda_1),\qquad d=R\delta.
$$
Here $\delta\in[0,\pi]$ is the central <angle> and $d$ is the <great-circle distance>. The same identity follows from the <spherical law of cosines> by adding the north pole as the third vertex, with angular sides $\pi/2-\phi_1$ and $\pi/2-\phi_2$. This connects <spherical geometry> to position calculations in <astronomy> and to navigation on a spherical model of <Earth>. Choosing the surface model matters: https://ntrs.nasa.gov/api/citations/20170011116/downloads/20170011116.pdf[Paula Neeley and Anthony Narkawicz, Map Projection Induced Variations in Locations of Polygon Geofence Edges, NASA/TM-2017-219675 (2017), sections 2-3] distinguishes spherical and ellipsoidal <geodesics> and gives this coordinate identity.

For a toy example, put two points at <latitude> $30^\circ$, with equatorial <azimuths> $-60^\circ$ and $60^\circ$. The <great-circle distance> and the <arc length> along constant <latitude> are
$$
d=R\arccos\!\left(\frac14+\frac34\cos120^\circ\right)=R\arccos(-1/8)\approx1.696124R,\qquad \ell_{\mathrm{parallel}}=R\cos30^\circ\frac{2\pi}{3}\approx1.813799R.
$$
The <great circle> takes a shorter route by bending towards the pole in these <spherical coordinates>. To locate its highest <latitude>, the endpoint <unit vectors> are $p=(\sqrt3/4,-3/4,1/2)$ and $q=(\sqrt3/4,3/4,1/2)$. Their <great circle> lies in the <plane> through the origin with $z=2x/\sqrt3$. On its shorter arc, the maximum <latitude> occurs at $y=0$ and is $\arctan(2/\sqrt3)\approx49.106605^\circ$. Thus a <geodesic> can change <latitude> substantially even when its endpoints have equal <latitude>. These are lengths on an ideal <sphere>; the example illustrates the geometry rather than specifying an actual flight route.

\Image[/great-circle-versus-parallel-distance.png]
{title=On an ideal sphere, two points at latitude $30^\circ$ and longitudes $\pm60^\circ$ are joined by a shorter great-circle arc reaching latitude $49.106605^\circ$}

Historically, <spherical trigonometry> was prominent in teaching as well as in <astronomy>. John Conway and Alex Ryba note its presence in early twentieth-century school textbooks in https://www.cambridge.org/core/journals/mathematical-gazette/article/abs/remembering-spherical-trigonometry/5282E6A1C67D0BF0DBEC096EF8C1CBF5[Remembering spherical trigonometry, The Mathematical Gazette 100(547), March 2016, pages 1-8, DOI 10.1017/mag.2016.3]. Their introductory observation documents that teaching history; it does not identify a single inventor of the <spherical law of sines> or <spherical law of cosines>.