# Great-circle navigation

Great-circle navigation or orthodromic navigation (related to orthodromic course; from Ancient Greek ορθός (orthós) 'right angle' and δρόμος (drómos) 'path') is the practice of navigating a vessel (a ship or aircraft) along a great circle. Such routes yield the shortest distance between two points on the globe.

## Course

The great circle path may be found using spherical trigonometry; this is the spherical version of the inverse geodetic problem. If a navigator begins at P$_1$ = (φ$_1$,λ$_1$) and plans to travel the great circle to a point at point P$_2$ = (φ$_2$,λ$_2$) (see Fig. 1, φ is the latitude, positive northward, and λ is the longitude, positive eastward), the initial and final courses α$_1$ and α$_2$ are given by formulas for solving a spherical triangle
    ${\begin{aligned}\tan \alpha _{1}&={\frac {\cos \phi _{2}\sin \lambda _{12}}{\cos \phi _{1}\sin \phi _{2}-\sin \phi _{1}\cos \phi _{2}\cos \lambda _{12}}},\\\tan \alpha _{2}&={\frac {\cos \phi _{1}\sin \lambda _{12}}{-\cos \phi _{2}\sin \phi _{1}+\sin \phi _{2}\cos \phi _{1}\cos \lambda _{12}}},\\\end{aligned}}$
where λ$_{12}$ = λ$_2$ − λ$_1$ and the quadrants of α$_1$,α$_2$ are determined by the signs of the numerator and denominator in the tangent formulas (e.g., using the atan2 function). The central angle between the two points, σ$_{12}$, is given by
    $\tan \sigma _{12}={\frac {\sqrt {(\cos \phi _{1}\sin \phi _{2}-\sin \phi _{1}\cos \phi _{2}\cos \lambda _{12})^{2}+(\cos \phi _{2}\sin \lambda _{12})^{2}}}{\sin \phi _{1}\sin \phi _{2}+\cos \phi _{1}\cos \phi _{2}\cos \lambda _{12}}}.$
(The numerator of this formula contains the quantities that were used to determine tan α$_1$.) The distance along the great circle will then be s$_{12}$ = Rσ$_{12}$, where R is the assumed radius of the Earth and σ$_{12}$ is expressed in radians. Using the mean Earth radius, R = R$_1$ ≈ 6,371 km (3,959 mi) yields results for the distance s$_{12}$ which are within 1% of the geodesic length for the WGS84 ellipsoid; see Geodesics on an ellipsoid for details.

### Relation to geocentric coordinate system

Detailed evaluation of the optimum direction is possible if the sea surface is approximated by a sphere surface. The standard computation places the ship at a geodetic latitude φ$_s$ and geodetic longitude λ$_s$, where φ is considered positive if north of the equator, and where λ is considered positive if east of Greenwich. In the geocentric coordinate system centered at the center of the sphere, the Cartesian components are
       ${\mathbf {s} }=R\left({\begin{array}{c}\cos \varphi _{s}\cos \lambda _{s}\\\cos \varphi _{s}\sin \lambda _{s}\\\sin \varphi _{s}\end{array}}\right)$
and the target position is
       ${\mathbf {t} }=R\left({\begin{array}{c}\cos \varphi _{t}\cos \lambda _{t}\\\cos \varphi _{t}\sin \lambda _{t}\\\sin \varphi _{t}\end{array}}\right).$
The North Pole is at
       ${\mathbf {N} }=R\left({\begin{array}{c}0\\0\\1\end{array}}\right).$
The minimum distance d is the distance along a great circle that runs through s and t. It is calculated in a plane that contains the sphere center and the great circle,
       $d_{s,t}=R\theta _{s,t}$
where θ is the angular distance of two points viewed from the center of the sphere, measured in radians. The cosine of the angle is calculated by the dot product of the two vectors
       $\mathbf {s} \cdot \mathbf {t} =R^{2}\cos \theta _{s,t}=R^{2}(\sin \varphi _{s}\sin \varphi _{t}+\cos \varphi _{s}\cos \varphi _{t}\cos(\lambda _{t}-\lambda _{s}))$
If the ship steers straight to the North Pole, the travel distance is
       $d_{s,N}=R\theta _{s,N}=R(\pi /2-\varphi _{s})$
If a ship starts at t and swims straight to the North Pole, the travel distance is
       $d_{t,N}=R\theta _{t,n}=R(\pi /2-\varphi _{t})$

#### Derivation

The cosine formula of spherical trigonometry yields for the angle p between the great circles through s that point to the North on one hand and to t on the other hand
       $\cos \theta _{t,N}=\cos \theta _{s,t}\cos \theta _{s,N}+\sin \theta _{s,t}\sin \theta _{s,N}\cos p.$
       $\sin \varphi _{t}=\cos \theta _{s,t}\sin \varphi _{s}+\sin \theta _{s,t}\cos \varphi _{s}\cos p.$
The sine formula yields
       ${\frac {\sin p}{\sin \theta _{t,N}}}={\frac {\sin(\lambda _{t}-\lambda _{s})}{\sin \theta _{s,t}}}.$
Solving this for sin θ$_{s,t}$ and insertion in the previous formula gives an expression for the tangent of the position angle,
       $\sin \varphi _{t}=\cos \theta _{s,t}\sin \varphi _{s}+{\frac {\sin(\lambda _{t}-\lambda _{s})}{\sin p}}\cos \varphi _{t}\cos \varphi _{s}\cos p;$
       $\tan p={\frac {\sin(\lambda _{t}-\lambda _{s})\cos \varphi _{t}\cos \varphi _{s}}{\sin \varphi _{t}-\cos \theta _{s,t}\sin \varphi _{s}}}.$

#### Further details

Because the brief derivation gives an angle between 0 and π which does not reveal the sign (west or east of north ?), a more explicit derivation is desirable which yields separately the sine and the cosine of p such that use of the correct branch of the inverse tangent allows to produce an angle in the full range -π≤p≤π.
The computation starts from a construction of the great circle between s and t. It lies in the plane that contains the sphere center, s and t and is constructed rotating s by the angle θ$_{s,t}$ around an axis ω. The axis is perpendicular to the plane of the great circle and computed by the normalized vector cross product of the two positions:
       $\mathbf {\omega } ={\frac {1}{R^{2}\sin \theta _{s,t}}}\mathbf {s} \times \mathbf {t} ={\frac {1}{\sin \theta _{s,t}}}\left({\begin{array}{c}\cos \varphi _{s}\sin \lambda _{s}\sin \varphi _{t}-\sin \varphi _{s}\cos \varphi _{t}\sin \lambda _{t}\\\sin \varphi _{s}\cos \lambda _{t}\cos \varphi _{t}-\cos \varphi _{s}\sin \varphi _{t}\cos \lambda _{s}\\\cos \varphi _{s}\cos \varphi _{t}\sin(\lambda _{t}-\lambda _{s})\end{array}}\right).$
A right-handed tilted coordinate system with the center at the center of the sphere is given by the following three axes: the axis s, the axis
       $\mathbf {s} _{\perp }=\omega \times {\frac {1}{R}}\mathbf {s} ={\frac {1}{\sin \theta _{s,t}}}\left({\begin{array}{c}\cos \varphi _{t}\cos \lambda _{t}(\sin ^{2}\varphi _{s}+\cos ^{2}\varphi _{s}\sin ^{2}\lambda _{s})-\cos \lambda _{s}(\sin \varphi _{s}\cos \varphi _{s}\sin \varphi _{t}+\cos ^{2}\varphi _{s}\sin \lambda _{s}\cos \varphi _{t}\sin \lambda _{t})\\\cos \varphi _{t}\sin \lambda _{t}(\sin ^{2}\varphi _{s}+\cos ^{2}\varphi _{s}\cos ^{2}\lambda _{s})-\sin \lambda _{s}(\sin \varphi _{s}\cos \varphi _{s}\sin \varphi _{t}+\cos ^{2}\varphi _{s}\cos \lambda _{s}\cos \varphi _{t}\cos \lambda _{t})\\\cos \varphi _{s}[\cos \varphi _{s}\sin \varphi _{t}-\sin \varphi _{s}\cos \varphi _{t}\cos(\lambda _{t}-\lambda _{s})]\end{array}}\right)$
and the axis ω. A position along the great circle is
       $\mathbf {s} (\theta )=\cos \theta \mathbf {s} +\sin \theta \mathbf {s} _{\perp },\quad 0\leq \theta \leq 2\pi .$
The compass direction is given by inserting the two vectors s and s$_⊥$ and computing the gradient of the vector with respect to θ at θ=0.
       ${\frac {\partial }{\partial \theta }}\mathbf {s} _{\mid \theta =0}=\mathbf {s} _{\perp }.$
The angle p is given by splitting this direction along two orthogonal directions in the plane tangential to the sphere at the point s. The two directions are given by the partial derivatives of s with respect to φ and with respect to λ, normalized to unit length:
       $\mathbf {u} _{N}=\left({\begin{array}{c}-\sin \varphi _{s}\cos \lambda _{s}\\-\sin \varphi _{s}\sin \lambda _{s}\\\cos \varphi _{s}\end{array}}\right);$
       $\mathbf {u} _{E}=\left({\begin{array}{c}-\sin \lambda _{s}\\\cos \lambda _{s}\\0\end{array}}\right);$
       $\mathbf {u} _{N}\cdot \mathbf {s} =\mathbf {u} _{E}\cdot \mathbf {u} _{N}=0$
u$_N$ points north and u$_E$ points east at the position s. The position angle p projects s$_⊥$ into these two directions,
       $\mathbf {s} _{\perp }=\cos p\,\mathbf {u} _{N}+\sin p\,\mathbf {u} _{E}$,
where the positive sign means the positive position angles are defined to be north over east. The values of the cosine and sine of p are computed by multiplying this equation on both sides with the two unit vectors,
       $\cos p=\mathbf {s} _{\perp }\cdot \mathbf {u} _{N}={\frac {1}{\sin \theta _{s,t}}}[\cos \varphi _{s}\sin \varphi _{t}-\sin \varphi _{s}\cos \varphi _{t}\cos(\lambda _{t}-\lambda _{s})];$
       $\sin p=\mathbf {s} _{\perp }\cdot \mathbf {u} _{E}={\frac {1}{\sin \theta _{s,t}}}[\cos \varphi _{t}\sin(\lambda _{t}-\lambda _{s})].$
Instead of inserting the convoluted expression of s$_⊥$, the evaluation may employ that the triple product is invariant under a circular shift of the arguments:
       $\cos p=(\mathbf {\omega } \times {\frac {1}{R}}\mathbf {s} )\cdot \mathbf {u} _{N}=\omega \cdot ({\frac {1}{R}}\mathbf {s} \times \mathbf {u} _{N}).$
If atan2 is used to compute the value, one can reduce both expressions by division through cos φ$_t$ and multiplication by sin θ$_{s,t}$, because these values are always positive and that operation does not change signs; then effectively
       $\tan p={\frac {\sin(\lambda _{t}-\lambda _{s})}{\cos \varphi _{s}\tan \varphi _{t}-\sin \varphi _{s}\cos(\lambda _{t}-\lambda _{s})}}.$

## Finding way-points

To find the way-points, that is the positions of selected points on the great circle between P$_1$ and P$_2$, we first extrapolate the great circle back to its node A, the point at which the great circle crosses the equator in the northward direction: let the longitude of this point be λ$_0$ — see Fig 1. The azimuth at this point, α$_0$, is given by
    $\tan \alpha _{0}={\frac {\sin \alpha _{1}\cos \phi _{1}}{\sqrt {\cos ^{2}\alpha _{1}+\sin ^{2}\alpha _{1}\sin ^{2}\phi _{1}}}}.$
Let the angular distances along the great circle from A to P$_1$ and P$_2$ be σ$_{01}$ and σ$_{02}$ respectively. Then using Napier's rules we have
    $\tan \sigma _{01}={\frac {\tan \phi _{1}}{\cos \alpha _{1}}}\qquad$(If φ$_1$ = 0 and α$_1$ = 1⁄2π, use σ$_{01}$ = 0).
This gives σ$_{01}$, whence σ$_{02}$ = σ$_{01}$ + σ$_{12}$.
The longitude at the node is found from
    ${\begin{aligned}\tan \lambda _{01}&={\frac {\sin \alpha _{0}\sin \sigma _{01}}{\cos \sigma _{01}}},\\\lambda _{0}&=\lambda _{1}-\lambda _{01}.\end{aligned}}$
Finally, calculate the position and azimuth at an arbitrary point, P (see Fig. 2), by the spherical version of the direct geodesic problem. Napier's rules give
    ${\color {white}.\,\qquad )}\tan \phi ={\frac {\cos \alpha _{0}\sin \sigma }{\sqrt {\cos ^{2}\sigma +\sin ^{2}\alpha _{0}\sin ^{2}\sigma }}},$
    ${\begin{aligned}\tan(\lambda -\lambda _{0})&={\frac {\sin \alpha _{0}\sin \sigma }{\cos \sigma }},\\\tan \alpha &={\frac {\tan \alpha _{0}}{\cos \sigma }}.\end{aligned}}$
The atan2 function should be used to determine σ$_{01}$, λ, and α. For example, to find the midpoint of the path, substitute σ = 1⁄2(σ$_{01}$ + σ$_{02}$); alternatively to find the point a distance d from the starting point, take σ = σ$_{01}$ + d/R. Likewise, the vertex, the point on the great circle with greatest latitude, is found by substituting σ = +1⁄2π. It may be convenient to parameterize the route in terms of the longitude using
    $\tan \phi =\cot \alpha _{0}\sin(\lambda -\lambda _{0}).$
Latitudes at regular intervals of longitude can be found and the resulting positions transferred to the Mercator chart allowing the great circle to be approximated by a series of rhumb lines. The path determined in this way gives the great ellipse joining the end points, provided the coordinates $(\phi ,\lambda )$ are interpreted as geographic coordinates on the ellipsoid.
These formulas apply to a spherical model of the Earth. They are also used in solving for the great circle on the auxiliary sphere which is a device for finding the shortest path, or geodesic, on an ellipsoid of revolution; see the article on geodesics on an ellipsoid.

## Example

Compute the great circle route from Valparaíso, φ$_1$ = −33°, λ$_1$ = −71.6°, to Shanghai, φ$_2$ = 31.4°, λ$_2$ = 121.8°.
The formulas for course and distance give λ$_{12}$ = −166.6°, α$_1$ = −94.41°, α$_2$ = −78.42°, and σ$_{12}$ = 168.56°. Taking the earth radius to be R = 6371 km, the distance is s$_{12}$ = 18743 km.
To compute points along the route, first find α$_0$ = −56.74°, σ$_{01}$ = −96.76°, σ$_{02}$ = 71.8°, λ$_{01}$ = 98.07°, and λ$_0$ = −169.67°. Then to compute the midpoint of the route (for example), take σ = 1⁄2(σ$_{01}$ + σ$_{02}$) = −12.48°, and solve for φ = −6.81°, λ = −159.18°, and α = −57.36°.
If the geodesic is computed accurately on the WGS84 ellipsoid, the results are α$_1$ = −94.82°, α$_2$ = −78.29°, and s$_{12}$ = 18752 km. The midpoint of the geodesic is φ = −7.07°, λ = −159.31°, α = −57.45°.

## Gnomonic chart

A straight line drawn on a gnomonic chart is a portion of a great circle. When this is transferred to a Mercator chart, it becomes a curve. The positions are transferred at a convenient interval of longitude and this track is plotted on the Mercator chart for navigation.