Cross-track distance calculator
Find how far a point is from the line between two places, and which point on the line is closest. Pick A, B and P on a globe or map and read the distance.
A little further from familiar.
Find how far a point is from the line between two places, and which point on the line is closest. Pick A, B and P on a globe or map and read the distance.
The cross-track distance calculator measures how far a point is from the shortest path between two places, along Earth’s surface, and finds the closest point on that path. Navigators call the sideways distance cross-track error. It runs entirely in your browser and does not use your device’s location.
The line is the shortest great-circle arc from A to B. Distances are along Earth’s surface, not roads or travel times. The closest point is on the arc between A and B, so it is an end when P lies beyond one. Coincident or opposite ends have no unique line.
Dublin (53.3498, −6.2603) lies about 82.84 km (51.48 mi) to the right of the shortest path from London (51.5074, −0.1278) to New York (40.7128, −74.0060). The closest point on the path is near 52.6250°N, 6.5467°W, 455.86 km along from London.
The shortest path between two places on Earth is an arc of a great circle. The cross-track distance is how far a third point lies from that great circle, measured along the surface at a right angle to it. Navigators call the same quantity cross-track error when it describes how far a ship or aircraft has drifted from its planned track.
The great circle is treated as running all the way round the globe, so the distance is to the whole circle through A and B, not just the stretch between them. The side is given as seen travelling from A towards B, and it swaps if you swap the two ends.
The tool also finds the closest point on the arc between A and B and shows it as the pin N. When P is level with some part of the arc, N is the foot of the perpendicular, and the distance along the line is how far that is from A. When P lies beyond an end, no perpendicular reaches the arc between A and B, so N is the nearer end and the distance along the line is longer than the arc or negative.
Distances are measured along Earth’s surface, treating Earth as a sphere with a mean radius of 6,371.0088 km, so they can differ from ellipsoidal survey results by a fraction of a percent. They are not road distances or travel times.
Two identical ends do not define a line, and exactly opposite ends have infinitely many shortest paths, so the tool asks you to move one end. A point exactly a quarter of the way round the globe from the line is the same distance from every point of it, so it has no single closest point either.
It is the shortest distance from a point to a great-circle line, measured at a right angle to the line. In navigation it is called cross-track error: how far off the planned track you are.
A great circle goes all the way round the globe, but your line may stop at A and B. If the point is level with a part of the path beyond either end, the closest point of the line from A to B is that end.
Left and right are as seen travelling from A towards B along the shortest path. Swapping A and B swaps the sides.
Identical ends do not define a line, exactly opposite ends have many shortest paths, and a point exactly a quarter of the way round the globe from the line is the same distance from all of it.
Read the FAQ for more help, or explore all sixteen tools.