Hand Calculations logo Hand Calculations All help pages ▾

Cross Track Error⚠ unverified

Aerospace / Navigation · Compute the cross-track error relative to a great-circle path

Parameters

InputSymbolUnitDefaultDescription
latlat1.0Latitude of the current position, in degrees
lonlon1.0Longitude of the current position, in degrees
lat1lat11.0Latitude of the path start point, in degrees
lon1lon11.0Longitude of the path start point, in degrees
lat2lat21.0Latitude of the path end point, in degrees
lon2lon21.0Longitude of the path end point, in degrees
OutputSymbolUnitDescription
resulterrormCross-track error from the great-circle path, in metres (m)

The science & history

Understanding the Parameters

Derivation (Approaching a Proof)

Set up the spherical triangle with vertices at the path start point (call it 1), the current position (3), and the destination (2). The cross-track distance is the perpendicular from vertex 3 to the great circle through 1 and 2.

Angular distance from start to current. Convert the great-circle distance $d_{13}$ to an angle at the Earth's centre: $\delta_{13} = d_{13}/R$ (arc length over radius).

Heading deviation. The bearing from start to current position is $\theta_{13}$; the bearing from start to destination (the desired track) is $\theta_{12}$. Their difference $\Delta\theta = \theta_{13}-\theta_{12}$ is the angle, at the start vertex, between "the way we actually went" and "the way we should go."

Napier's rule for the right spherical triangle. Drop the perpendicular from the current position (3) to the desired track; call the cross-track angular distance $\delta_{xt}$. In the right spherical triangle formed by the start, the foot of the perpendicular, and the current position, the side opposite the angle $\Delta\theta$ is the cross-track arc, and the hypotenuse is $\delta_{13}$. The spherical sine rule for this right triangle gives:

$$\sin\delta_{xt} = \sin\delta_{13}\,\sin\Delta\theta.$$

Solve for the cross-track angular distance and convert back to metres by multiplying by $R$:

$$\delta_{xt} = \arcsin\!\big(\sin\delta_{13}\,\sin\Delta\theta\big) \quad\Longrightarrow\quad XTE = R\,\delta_{xt} = R\,\arcsin\!\big(\sin(d_{13}/R)\,\sin(\theta_{13}-\theta_{12})\big). \qquad\blacksquare$$

The $\sin\Delta\theta$ factor carries the sign: if the current position lies to the right of the track, $\Delta\theta$ is positive and so is $XTE$; to the left, both flip. This is the exact spherical result — no small-angle approximation — which is why it reuses the well-conditioned haversine distance and $\operatorname{atan2}$ bearings rather than re-deriving from raw coordinates.

Dimensional check. $d_{13}/R$ is dimensionless (an angle in radians); $\sin(\cdot)\sin(\cdot)$ is dimensionless, so $\arcsin$ returns radians, and $R\times$ radians gives metres ✓.

History and Development

Related Concepts: Great-Circle Distance, Initial Heading, Time To Go, Magnetic Heading, Ground Track Velocity

Notes: Signed perpendicular distance from the intended great-circle track; the sign = which way to steer (left/right). Built from Great-Circle Distance ($d_{13}$) + two Initial Heading bearings ($\theta_{13},\theta_{12}$) via the right-spherical-triangle sine rule $\sin\delta_{xt}=\sin\delta_{13}\sin\Delta\theta$. Exact on the sphere; small-leg limit $XTE\approx d_{13}\sin\Delta\theta$. Lat/lon inputs labelled dimensionless but are degrees; $R$ hard-coded $6{,}371$ km. The core signal of RNAV/RNP lateral guidance.

← Back to the workspace  ·  All help pages  ·  Getting started