Sphere Distance Calculator
Calculate the great-circle distance between two points on a sphere.
Enter the coordinates of two points (latitude and longitude in decimal degrees) and the sphere radius. The great-circle distance is calculated instantly using the Haversine formula.
Point A
°
°
Point B
°
°
km
Default: Earth = 6371 km
Great-circle distance
—
km
Coordinates on a sphere
A point on a sphere is located by two angles:
- Latitude (φ) — the angle from the equatorial plane, ranging from −90° (South Pole) to +90° (North Pole).
- Longitude (λ) — the angle measured eastward from the prime meridian, ranging from −180° to +180°.
Coordinates are given in decimal degrees (e.g. Paris: 48.8566°N, 2.3522°E). Negative latitude means South; negative longitude means West.
The sphere radius can be any positive value. For Earth, the commonly used mean radius is km.
Haversine formula
Let , and , be the latitudes and longitudes of the two points (in radians), and the sphere radius:
where is the great-circle distance. The arctan2 form is preferred over arcsin for better numerical stability.
Frequently Asked Questions
The Haversine formula calculates the great-circle distance between two points on a sphere, given their latitudes and longitudes. It is named after the haversine function: hav(θ) = sin²(θ/2). The formula is particularly suited for navigation because it is numerically stable even for very short or nearly antipodal distances. It assumes the Earth is a perfect sphere; for high-precision geodesy, ellipsoidal models like Vincenty's formula are used.
The great-circle distance is the shortest path between two points measured along the surface of a sphere. A great circle is any circle on the sphere whose plane passes through the center. The equator and all meridians are great circles. Aircraft and ships follow great-circle routes to minimize travel distance — that is why transatlantic flights curve northward over Greenland.
The default radius is 6371 km — the mean radius of Earth as defined by the IUGG. Earth is not a perfect sphere: the equatorial radius is 6378.1 km and the polar radius is 6356.8 km. For everyday navigation, 6371 km gives results accurate to within about 0.5%.
Yes — simply change the sphere radius. Common values: Moon 1737.4 km, Mars 3389.5 km, Venus 6051.8 km, Jupiter 69911 km. The Haversine formula works for any sphere and is unit-independent.