Coordinate Distance Calculator
Calculate the distance between two points using geographic (Haversine, Vincenty) or Cartesian coordinates with bearing, midpoint, and unit conversion.
About
Miscalculating the distance between two coordinate points leads to cumulative positioning errors in surveying, navigation route planning, and geospatial data analysis. A naive flat-Earth Euclidean approximation on geographic coordinates introduces errors exceeding 20% at high latitudes or over distances above 100km. This tool implements both the Haversine formula (spherical model, R = 6371.0088km) and Vincenty's inverse formulae (WGS-84 ellipsoid, a = 6378137m, f = 1/298.257223563) to compute geodesic distances with sub-meter precision. For Cartesian coordinate systems it computes Euclidean and Manhattan distances in 2D and 3D space.
The tool also derives initial and final bearings, geographic midpoint coordinates, and supports output in 6 distance units. Results approximate real-world distances assuming no terrain elevation changes. For geographic mode, accuracy degrades for nearly antipodal points where Vincenty iteration may not converge. In such edge cases the calculator falls back to the Haversine result automatically.
Formulas
The Haversine formula computes the great-circle distance between two points on a sphere from their latitudes and longitudes:
Where Ď1, Ď2 are latitudes in radians, ÎĎ = Ď2 â Ď1, ÎÎť = Îť2 â Îť1, and R = 6371.0088 km (mean Earth radius).
The initial bearing (forward azimuth) from point 1 to point 2:
For Cartesian coordinates, the Euclidean distance in 2D:
And in 3D:
The Manhattan distance (L1 norm) sums absolute component differences: dM = |x2 â x1| + |y2 â y1| + |z2 â z1|.
Reference Data
| Constant / Parameter | Symbol | Value | Context |
|---|---|---|---|
| Mean Earth Radius (IUGG) | R | 6371.0088 km | Haversine spherical model |
| WGS-84 Semi-major Axis | a | 6378137.0 m | Vincenty ellipsoid |
| WGS-84 Flattening | f | 1/298.257223563 | Vincenty ellipsoid |
| WGS-84 Semi-minor Axis | b | 6356752.3142 m | Derived: aĂ(1âf) |
| Kilometer | km | 1.0 | Base unit (geographic) |
| Mile (statute) | mi | 0.621371 mi/km | US/UK standard |
| Nautical Mile | nmi | 0.539957 nmi/km | Aviation / Maritime |
| Meter | m | 1000 m/km | SI base |
| Foot | ft | 3280.84 ft/km | US Customary |
| Yard | yd | 1093.61 yd/km | US Customary |
| Latitude Range | Ď | [â90, 90]° | Geographic constraint |
| Longitude Range | Îť | [â180, 180]° | Geographic constraint |
| Vincenty Max Iterations | - | 200 | Convergence limit |
| Vincenty Tolerance | Îľ | 1Ă10â12 | Radian precision |
| Haversine Error (100 km) | - | ⤠0.3% | Spherical approximation |
| Haversine Error (1000 km) | - | ⤠0.5% | Spherical approximation |
| Vincenty Accuracy | - | ⤠0.5mm | Ellipsoidal model |
| Equator Circumference | - | 40075.017 km | Maximum great-circle |
| Polar Circumference | - | 40007.863 km | Meridional great-circle |
| 1° Latitude at Equator | - | 110.574 km | Linear approximation |
| 1° Longitude at Equator | - | 111.320 km | Decreases with cos(Ď) |