Cross-track and along-track distance
How far a point is off the course line from A to B (right of course positive), how far along the course its closest point lies, and that point, on the ellipsoid to the millimeter.
Planning and education aid. Not for primary navigation. Full disclaimer
The point is 324.595126 km off course, 1,149.281189 km along it.
- Along-track distance
- Closest point latitude
- Closest point longitude
- Within the segment
- Segment length
Provenance
- Computed by
- navigation.route.cross-track 1.0.1, core 0.1.0
- Model
- Closest point on the geodesic by Karney's interception method on WGS 84
- Accuracy
- Foot point within 1 mm of a brute-force search along the geodesic; the spherical method is the classic formula on the mean radius
- Notes
- None
- Cites
- Karney, C. F. F., Journal of Geodesy, Algorithms for geodesics
Something look off?
How we got thisFormula, worked example, sources, and proof
Model: Closest point on the geodesic by Karney's interception method on WGS 84
Accuracy: Foot point within 1 mm of a brute-force search along the geodesic; the spherical method is the classic formula on the mean radius
When to use this: Use this when you want to know how far off a course line you are, and where along the line your closest point lies: checking a track against a planned leg, measuring a deviation, or finding where to rejoin. Right of course is positive, so the sign tells you which way to correct.
Limitations: It measures distance from the course line on the ellipsoid, not from a corridor's edge or an airway's protected width, and it does not know whether the closest point lies between the ends of the leg or beyond them, so check the along-track distance before acting on it. Heights play no part, and the answer is geometry rather than guidance.
Worked example: Off course on the JFK to London Heathrow line. Source: navigation route-geometry scenario: a point south-east of the JFK-LHR geodesic near the start is right of course. It is golden test vector v001, and every build checks the tool still gives its answer within its tolerance.
You enter
- Point latitude
- 44 deg
- Start latitude
- 40.6413 deg
- End latitude
- 51.47 deg
- Point longitude
- -60 deg
- Start longitude
- -73.7781 deg
- End longitude
- -0.4543 deg
You get
- Cross-track distance
- 324.595126 km
- Along-track distance
- 1,149.281189 km
- Closest point latitude
- 46.5353189°
- Closest point longitude
- -62.05414°
- Within the segment
- yes
- Segment length
- 5,554.909 km
Review: Not yet independently reviewed by a geodesist.
Last verified: 2026-09-18, when a maintainer last confirmed this tool's sources at the issuer. See the sources ledger.
Status: version 1.0.1, core 0.1.0. See this tool in the verification report.
Changes
- 2026-09-23, fixed: Short distances lost their meaning: a 0.859 m geodesic showed as 0.001 km. Distances in the navigation tools (version 1.0.1) still show to the meter in kilometers, but a short one now keeps three significant digits, down to the millimeter, so it shows as 0.000859 km. Differences such as the rhumb line's extra distance keep fixed decimals. Values are unchanged. Changelog
- 2026-09-19, changed: Cross-track distance is stable. Its spherical method reproduces the Aviation Formulary's LAX to JFK example (7.4512 nm off course, 99.588 nm along it) once the formulary's minute-of-arc radius is accounted for, and the ellipsoidal foot point matches a brute-force search along the geodesic within a millimeter. Results are unchanged. Changelog
- 2026-09-19, added: New navigation tools: rhumb lines, cross-track and along-track distance, fly-by turn anticipation, time-speed-distance with arrival times, closest point of approach, and route legs with true and magnetic courses; and the first geometry tool, polygon area on the ellipsoid. Changelog
Checked against: 23 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.
Sources
- Algorithms for geodesics, Karney, C. F. F., Journal of Geodesy, Vol. 87, No. 1. pp. 43-55.