Fact-checked by Grok 2 weeks ago

Great-circle distance

The great-circle distance is the shortest path along the surface of a between two distinct points, corresponding to the of the that connects them. A itself is the largest possible circle on a , formed by the of the with any passing through its , and thus sharing the 's full . This geometric property ensures that the great-circle path is the true —the minimal-distance route—on a spherical surface, distinguishing it from longer routes like rhumb lines, which maintain a bearing but cover greater distances. In practical applications, particularly for Earth's approximate spherical , great-circle distances are to in and contexts, enabling the most efficient routes that reduce time and consumption. For instance, transoceanic flights often follow great-circle paths, appearing curved on flat maps due to distortions. Computationally, the distance can be derived from latitude and longitude coordinates using , with common methods including the or the , which accounts for angular differences to yield arc lengths in units like nautical miles or kilometers. These calculations assume a mean of approximately 6,371 km, though more precise ellipsoidal models adjust for the planet's in advanced .

Fundamentals of Spherical Geometry

Definition of Great-Circle Distance

The great-circle distance between two points on the surface of a is defined as the shortest path connecting them, which lies along the arc of the passing through those points. This assumes the sphere is perfect and uniform, with no irregularities such as those found on . On a , great circles represent the geodesics, or straightest possible paths, analogous to straight lines in but curved on the surface. Geometrically, this distance corresponds to the arc length of the great circle segment between the points, calculated as the product of the sphere's radius and the central angle subtended by that arc at the sphere's center, with the angle expressed in radians. This formulation distinguishes great-circle distance from straight-line (chord) distances through the sphere's interior or planar approximations on flat maps, emphasizing surface travel. In practice, great-circle distances are typically expressed in linear units such as kilometers or , where one approximates the of one minute of along a . For Earth's approximate , the equatorial has a of about 40,075 kilometers, illustrating the global scale of such measurements. The concept of great-circle distance originates from the foundations of in , where it was formalized by astronomers like in the 2nd century CE through works such as the , which explored and arc measurements on .

Role of Great Circles and Central Angle

In , great circles represent the largest possible circles on the surface of a , formed by the intersection of the with any plane that passes through its center. Examples include the and all meridians of , which divide the into two equal hemispheres. These circles are fundamental because the shortest path between any two points on a —known as the —always lies along a great circle, making them analogous to straight lines in . The , often denoted as Δσ or θ, is the angle subtended at the center of by the of a connecting two points on the surface. This angle measures the angular separation between the points and ranges from 0 to π radians (or 0° to 180°), corresponding to the shorter between non-antipodal points. For visualization, consider two points A and B on : the plane defined by the sphere's center and these points intersects in a unique , along which the AB subtends the central angle at the center; however, if A and B are antipodal (directly opposite), infinitely many s pass through them. The arc length d along this great circle is given by d = R Δσ, where R is the sphere's radius and Δσ is the in radians, providing a direct geometric link between angular and linear measures on the sphere. Points on the sphere are typically represented using spherical coordinates, such as (the angle north or south of the , ranging from -90° to 90°) and (the angle east or west of the , ranging from -180° to 180°), which facilitate locating positions relative to the sphere's center.

Core Formulas for Distance Calculation

Spherical Law of Cosines

The is a fundamental theorem in that relates the sides and of a spherical , extending the planar to account for the of a . For a spherical triangle with arc sides a, b, c (measured in angular units) and opposite A, B, C, the formula is given by \cos c = \cos a \cos b + \sin a \sin b \cos C. This equation arises from the geometry of great circles on a unit sphere, where the sides represent central angles subtended at the sphere's center. To apply this to great-circle distance, consider two points on the sphere defined by latitudes \phi_1 and \phi_2 (in radians) and longitudes \lambda_1 and \lambda_2. These points, along with the north pole, form a spherical triangle where the co-latitudes a = \frac{\pi}{2} - \phi_1 and b = \frac{\pi}{2} - \phi_2 are the sides from the pole, and the included angle C = |\lambda_2 - \lambda_1| = \Delta\lambda is the difference in longitude. The opposite side c then corresponds to the central angle \Delta\sigma between the points. Substituting into the spherical law of cosines yields \cos(\Delta\sigma) = \sin \phi_1 \sin \phi_2 + \cos \phi_1 \cos \phi_2 \cos(\Delta\lambda). Solving for \Delta\sigma = \arccos(\cdot) gives the angular separation, and the great-circle distance is d = R \Delta\sigma, where R is the sphere's radius. To compute the distance step-by-step from coordinates (\phi_1, \lambda_1) and (\phi_2, \lambda_2):
  1. Convert latitudes and the longitude difference \Delta\lambda = |\lambda_2 - \lambda_1| to radians.
  2. Evaluate \cos(\Delta\sigma) = \sin \phi_1 \sin \phi_2 + \cos \phi_1 \cos \phi_2 \cos(\Delta\lambda).
  3. Compute \Delta\sigma = \arccos[\cos(\Delta\sigma)], ensuring \Delta\sigma is in radians and between 0 and \pi.
  4. Multiply by the radius: d = R \Delta\sigma.
This direct trigonometric approach is particularly simple for small angular separations, where approximations like small-angle limits align closely with planar distances. However, it exhibits limitations near antipodal points, where \cos(\Delta\sigma) \approx -1, potentially leading to ambiguity in distinguishing the exact \pi separation due to computational rounding. For instance, the great-circle distance between (approximately $40.7^\circ N, $74^\circ W) and (approximately $51.5^\circ N, $0^\circ W) is about 5,570 km when using Earth's mean radius R = 6,371 km in the formula.

Haversine Formula

The haversine formula provides a numerically stable method for computing the great-circle distance between two points on a sphere given their latitudes and longitudes, making it particularly suitable for applications in navigation and geospatial analysis where small angular separations are common. The core of the formula relies on the haversine function, defined as \hav(\theta) = \sin^2(\theta/2), which transforms the spherical law of cosines into a form that avoids catastrophic cancellation in floating-point arithmetic when longitude differences are near zero. This stability arises because the haversine expression uses squared sines, preventing the subtraction of two nearly equal cosine values that can occur in direct cosine-based calculations. The formula itself, known as the law of haversines, is expressed as: \hav(\Delta\sigma) = \hav(\phi_2 - \phi_1) + \cos\phi_1 \cos\phi_2 \hav(\Delta\lambda) where \phi_1 and \phi_2 are the latitudes of the two points, \Delta\lambda is the absolute difference in their longitudes, and \Delta\sigma is the subtended by the points at the sphere's center. Solving for the central angle gives \Delta\sigma = 2 \arcsin(\sqrt{\hav(\Delta\sigma)}). The great-circle distance d is then d = R \Delta\sigma, with R as the sphere's radius (typically Earth's mean radius for geodetic applications). This derivation stems from the by applying the half-angle identity $1 - \cos x = 2 \sin^2(x/2), which rearranges the cosine terms into haversines to enhance computational precision. To implement the haversine formula, latitudes and longitudes must first be converted from degrees to radians. The differences \Delta\phi = \phi_2 - \phi_1 and \Delta\lambda are computed, followed by hav(\Delta\phi) = sin²(\Delta\phi / 2) and hav(\Delta\lambda) = sin²(\Delta\lambda / 2). These are substituted into the law of haversines to obtain \hav(\Delta\sigma), from which \Delta\sigma is derived via the arcsin operation, and the distance is scaled by the radius. This step-by-step process ensures accuracy even for antipodal points or near-equatorial paths. The haversine approach originated in and gained prominence in through early 19th-century tables; the first English haversine tables were published by James Andrew in 1805, building on prior work by José de Mendoza y Ríos around 1801 for simplifying observations. It proved superior for manual computations in maritime and aviation contexts due to its reduced sensitivity to small errors in angle measurements, and today it remains a standard in GPS software and for its efficiency and reliability when points are closely spaced. For instance, applying the formula to coordinates for (approximately 40.7128° N, 74.0060° W) and (51.5074° N, 0.1278° W) yields a great-circle distance of about 5,570 km.

Relations to Chord Length and Vectors

Central Angle from Chord Length

In , the chord length c represents the straight-line through the interior of connecting two points on its surface that lie along a , separated by a \Delta\sigma. This length is derived from the formed by the two radii R to the points and the as the base. By bisecting the triangle, the half-chord c/2 forms a with the radius R and half-angle \Delta\sigma/2, yielding the relation \sin(\Delta\sigma/2) = (c/2)/R. Thus, the formula is c = 2R \sin\left(\frac{\Delta\sigma}{2}\right), where R is the sphere's radius. To find the central angle from a known chord length, invert the relation: \Delta\sigma = 2 \arcsin\left(\frac{c}{2R}\right). Once \Delta\sigma is obtained, the great-circle distance d along the surface arc is d = R \Delta\sigma. This inversion is geometrically straightforward, as the arcsin function maps the normalized half-chord to the half-angle in the range [0, \pi] for \Delta\sigma \in [0, 2\pi], though practical computations typically consider the shorter arc (\Delta\sigma \leq \pi). This approach finds applications in contexts where chord lengths are directly measurable or computed. However, the method assumes a precisely known radius R; moreover, it is invalid for c > 2R, as no such chord exists on a sphere of radius R.

Vector-Based Computations

Vector-based computations provide an efficient means to calculate great-circle distances by representing points on the sphere as unit vectors in 3D Cartesian space, leveraging linear algebra operations like the . This approach is particularly suited for implementation in programming environments and geospatial software, where vector operations are optimized for performance. To begin, convert the geodetic coordinates of latitude \phi and longitude \lambda (in radians) for each point into Cartesian coordinates on the unit sphere: \mathbf{a} = \begin{pmatrix} \cos \phi_a \cos \lambda_a \\ \cos \phi_a \sin \lambda_a \\ \sin \phi_a \end{pmatrix}, \quad \mathbf{b} = \begin{pmatrix} \cos \phi_b \cos \lambda_b \\ \cos \phi_b \sin \lambda_b \\ \sin \phi_b \end{pmatrix} These unit vectors \hat{\mathbf{a}} and \hat{\mathbf{b}} point from the sphere's center to the respective points. The central angle \Delta\sigma between the two points is then determined using the dot product of these unit vectors, which equals the cosine of the angle between them: \cos \Delta\sigma = \hat{\mathbf{a}} \cdot \hat{\mathbf{b}} = \cos \phi_a \cos \phi_b \cos(\lambda_a - \lambda_b) + \sin \phi_a \sin \phi_b Thus, \Delta\sigma = \arccos(\hat{\mathbf{a}} \cdot \hat{\mathbf{b}}). The great-circle distance d is obtained by multiplying this angle by the sphere's radius R: d = R \cdot \Delta\sigma This method directly links to the chord length via the relation |\hat{\mathbf{a}} - \hat{\mathbf{b}}| = 2 \sin(\Delta\sigma / 2), but focuses on the angular separation for distance. For verification or additional computations, such as initial bearing (azimuth), the cross product can be used: the magnitude |\hat{\mathbf{a}} \times \hat{\mathbf{b}}| = \sin \Delta\sigma, confirming the angle without relying solely on the arccosine, which can be sensitive near \Delta\sigma = 0 or \pi. The full cross product vector also provides the plane's normal, aiding in direction calculations. This vector approach handles antipodal points (\hat{\mathbf{a}} = -\hat{\mathbf{b}}) robustly, as \hat{\mathbf{a}} \cdot \hat{\mathbf{b}} = -1 yields \Delta\sigma = \pi, corresponding to half the sphere's circumference. The efficiency of vector-based methods shines in libraries supporting hardware-accelerated linear algebra, such as in or similar tools in and GIS software, where s are computed in constant time regardless of coordinate complexity. For instance, consider two points on the at longitudes 0° and 90° (both at \phi = 0): \hat{\mathbf{a}} = (1, 0, 0) and \hat{\mathbf{b}} = (0, 1, 0). Their is 0, so \Delta\sigma = \pi/2, and for Earth's mean radius R \approx 6371 , d \approx 10{,}008 .

Applications and Practical Aspects

Earth's Spherical Approximation and Radius

The spherical approximation models Earth as a perfect sphere, neglecting its oblateness due to rotation, which simplifies great-circle distance calculations for navigation and mapping applications. This model is sufficiently accurate for most purposes, introducing errors of up to 0.5% compared to ellipsoidal computations, particularly for long-distance routes. Standard values for Earth's radius in the spherical model include the radius of 6,371 km, derived from the World Geodetic System 1984 (WGS84) ellipsoid parameters. The equatorial measures 6,378 km, while the polar is 6,357 km, reflecting the planet's slight . For enhanced consistency in area-preserving projections, the authalic of 6,371.007 km is used, as it equates the sphere's surface area to that of the ; alternatively, the volumetric mean of approximately 6,371.001 km matches the ellipsoid's volume. Selection of the radius depends on the application: the equatorial radius is preferred in for routes near the , whereas the mean radius suits general-purpose calculations across varied latitudes. A 1 km error in the chosen radius propagates to about 0.016% relative error in a 1,000 km great-circle path, underscoring the need for precise values in high-accuracy contexts. Historically, the International of 1924 defined an equatorial radius of 6,378.388 km and polar radius of 6,356.912 km, based on Hayford's 1909 determinations. In contrast, the WGS84 system, established in 1984 and refined for , adopts slightly adjusted parameters and remains the standard for GPS applications. For example, the great-circle distance from New York (40.71° N, 74.01° W) to London (51.51° N, 0.13° W) using the mean radius of 6,371 km is approximately 5,570 km.

Numerical Considerations and Accuracy

Computing the great-circle distance on a sphere using standard formulas introduces several numerical challenges, primarily arising from floating-point arithmetic limitations and the inherent properties of the trigonometric functions involved. One major error source is catastrophic cancellation in the computation of cos(Δλ) within the spherical law of cosines formula when points are close together, particularly if they share similar latitudes; here, small differences in longitude lead to a value near 1, where subtracting approximations of nearby quantities amplifies relative errors due to limited mantissa precision. Another issue is the instability of the arccos function near arguments of 1 (for small central angles Δσ ≈ 0) or -1 (for Δσ ≈ π), where tiny perturbations in the input—often from rounding—result in disproportionately large outputs; this is exacerbated near Δσ = 0, as the derivative of arccos(x) diverges at x = 1. Floating-point precision further compounds these problems: single-precision (32-bit) arithmetic typically yields unreliable results for distances below 1 km, while double-precision (64-bit) maintains accuracy down to about 10 meters before significant degradation occurs. To mitigate these issues, the is preferred over the for its superior , as it employs the function and squared sines to avoid direct subtraction near 1 and the problematic ; this reformulation ensures well-conditioned results even for sub-kilometer distances. For very small central angles (Δσ ≪ 1 ), series expansions provide further refinement, such as the approximation Δσ ≈ 2 √[hav(Δσ)], where hav(Δσ) = sin²(Δσ/2) ≈ (Δσ/2)², allowing direct estimation without inverse trig functions and reducing error to levels. High-accuracy applications may employ iterative methods, like Newton-Raphson refinements on the haversine , to achieve sub-millimeter precision beyond standard implementations. Accuracy benchmarks demonstrate the practical impact: the in double precision can err by approximately 10 meters for points 1 km apart due to instability, whereas the limits numerical errors to less than 0.5 mm per km traveled, aligning closely with exact spherical computations as verified against reference functions like MATLAB's distance. In Geographic Information Systems (GIS), such as implementations, great-circle distances leverage haversine-based geography types for robust handling of spherical calculations, often achieving errors under 1 meter for global scales when using double precision. Modern applications, particularly in GPS navigation, require addressing datum shifts—transformations between reference frames like and older datums such as —which can introduce positional errors up to tens of meters if not corrected before applying great-circle formulas; post-2000 advancements emphasize preprocessing coordinates via standardized transformations (e.g., Helmert parameters) to maintain sub-meter accuracy in distance computations. These numerical considerations remain underexplored in pre-2000 literature, highlighting the need for updated practices in software libraries and geospatial tools.

References

  1. [1]
    Spherical Distance -- from Wolfram MathWorld
    ... along a great circle. For points P and Q on the unit sphere, the spherical distance is given by d=cos^(-1)(P·Q), where P·Q denotes a dot product.
  2. [2]
    Great Circle -- from Wolfram MathWorld
    A great circle is a section of a sphere that contains a diameter of the sphere (Kern and Bland 1948, p. 87). Sections of the sphere that do not contain a ...
  3. [3]
    [PDF] A Comparative Analysis of Rhumb Lines and Great Circles
    May 13, 2016 · Definition 2.1. [Great Circle] A great circle is the shortest distance on Earth from one place to the next. Definition 2.2. [Meridian] ...
  4. [4]
    Great Circle Route | Time and Navigation - Smithsonian Institution
    A great circle is the shortest distance between two points on a globe, an arc, not a straight line, which complicates navigation.
  5. [5]
    Aviation Formulary V1.47
    This introduction is written for pilots (and others) who are interested in great circle navigation and would like to know how to compute courses, headings and ...Introduction to Great Circle... · Great Circle Navigation... · Rhumb Line Navigation
  6. [6]
    Why Are Great Circles the Shortest Flight Path? - GIS Geography
    Great circles are the shortest flight paths because they are the shortest route in 3D space, and map projections distort straight lines, making them appear ...
  7. [7]
    Latitude/Longitude Calculations: Formulas & Code
    Calculate distance, bearing and more between Latitude/Longitude points · Formula: φ2 = φ1 + δ ⋅ cos θ. Δψ = ln( tan(π/4 + φ2/2) / tan(π/4 + φ1/2) ). q = Δφ / Δψ ...<|separator|>
  8. [8]
    [PDF] Paths Between Points on Earth: Great Circles, Geodesics, and ...
    (Mathematically you can take the three points of the end points and the earth center and define this plane.) The great circle is the shortest distance between ...
  9. [9]
    Chapter 3: Section 7: Part 4
    A geodesic on a sphere is a great circle, formed by the intersection of the sphere with a plane through its center. The shortest distance is along this great ...
  10. [10]
    Spherical Trigonometry and Navigation - Stony Brook University
    The distance between points X and Y on the Earth is the length of the great-circle arc between them. This length can be expressed essentially as an angle ...
  11. [11]
  12. [12]
    How large is Earth? - Cool Cosmos - Caltech
    Earth's circumference (the distance all the way around the equator) is 24,901 miles (40,075 kilometers). Its diameter (the distance from one side to the other ...
  13. [13]
    Chapter 2: Reference Systems - NASA Science
    Jan 16, 2025 · A great circle is an imaginary circle on the surface of a ... definition exactly 60 nautical miles. Because meridians converge at ...
  14. [14]
    Spherical Geometry - Astronomy 505
    A great circle is defined as the intersection between the surface of a sphere and a plane containing the center of the sphere.
  15. [15]
    [PDF] Spherical Trigonometry - UCLA Mathematics
    We will also assume the radius of the sphere is 1. Thus, the length of an arc of a great circle, is its angle. Figure 1: Central Plane of a Unit Sphere ...
  16. [16]
    [PDF] Exploration of Spherical Geometry
    Sep 9, 2003 · ... great circle, that is, a circle whose diameter is equal to the sphere's. We define an S-line to be a great circle. Consider two distinct ...
  17. [17]
    Geometry of the Sphere 2. - CSI Math
    Apr 15, 2021 · If A and B are two points on the sphere, then the distance between them is the distance along the great circle connecting them. Since this ...
  18. [18]
    [PDF] Spherical coordinates - Purdue Math
    It corresponds to the θ we defined. The latitude measures the angle formed north or south of the equator, and takes values in (-90◦,90◦). It is analogous ...
  19. [19]
    [PDF] MA 460 Supplement: spherical geometry - Purdue Math
    Given points P and Q, the spherical distance between them is the angle ZPOQ measured in radians which we use from now on for all angles (recall π radians = 180◦) ...
  20. [20]
    4. Great circle sailing
    This gives c = 74.36o or 4461.6 nautical miles. Once c is known, A can be calculated using the spherical law of sines:
  21. [21]
    earth_oblate_spheroid.html - UNLV Physics
    Earth Equatorial Radius R_eq_⊕ = 6378.1370 km. ; Earth polar radius R_po_⊕= 6356.7523 km. ; Earth mean radius R_me_⊕ = 6371.0088 km by the Earth conventional mean ...
  22. [22]
    Spherical Trigonometry -- from Wolfram MathWorld
    471), and the haversine formula for angles is given by. havA, = (sin(s-b)sin(s-c))/(sinbsinc). (46). = (hava-hav(b-c))/(sinbsinc). (47). = hav[pi-(B+C)]+ ...
  23. [23]
    Lost but lovely: The haversine | plus.maths.org
    Jul 4, 2014 · The term "haversine" apparently comes from "half versed sine". To see why this function is useful, put yourself in the shoes of an intrepid ...
  24. [24]
    Understanding The Distance Of Flights From London To New York
    Rating 8.1/10 (145) 10 hours ago · ... London to New York is approximately 3,459 miles (5,570 kilometers) ... This distance is a straight line, also known as the great circle distance.
  25. [25]
    Circular Segment -- from Wolfram MathWorld
    A circular segment is a portion of a disk with an arc as its upper boundary and a chord as its lower boundary, forming a central angle less than pi radians.
  26. [26]
    Visual contact for two satellites orbits under J2-gravity - ScienceDirect
    ... chord length vector between the satellites, it is evident that the satellites would not have direct line-of-sight communication. Owing to atmospheric ...
  27. [27]
    Vector-based spherical geodesy - Movable-type.co.uk
    Vector-based methods provide an alternative approach to latitude/longitude geodesy calculations from the more common spherical trigonometry methods.
  28. [28]
    [PDF] Time and motion - plus.maths.org - Millennium Mathematics Project
    We can therefore calculate the dot product r1.r2 = R2(cosθ1cosθ2(cosφ1cosφ2+sinφ1sinφ2) +sinθ1sinθ2). But there is another formula for the dot product: r1.
  29. [29]
    Fast geodesic approximations with Cheap Ruler | by Mapbox
    it's an oblate ellipsoid. Consequently, the Haversine formula can result in an error of up to 0.5%.
  30. [30]
    How WGS 84 defines the Earth
    Mean radius of the Earth = (2a+b)/3 = 6 371 008.7714 m. Surface area of the ... 724 km2 6 371 007.1809 m. Volume of the Earth = V = 4pa2b/3 = Radius of ...
  31. [31]
    WGS-84 Earth equatorial radius (meters) - vCalc
    Jul 6, 2023 · The Equatorial Radius of the Earth is 6,378,137.0 meters according to the WGS-84 earth datum. The data above is provided in meters.
  32. [32]
    The Earth as an Ellipsoid - Manifold Software
    The radius of the Earth along the polar axis is then 1/297 less than 6,378,388 or approximately 6,356,911.9 m. This is called the International ellipsoid and is ...
  33. [33]
    The Figure of the Earth and the New International Ellipsoid of ... - jstor
    Semi-major axis (equatorial radius) = 6 378 388 meters. Ellipticity (flattening) = 1/297. These figures are those deduced by Hayford¹ in. 1909 from the ...
  34. [34]
    Converting the Great Circle distance to direct distance between two ...
    May 25, 2016 · Then we can consider them as points that lie on a circle with radius r. The distance between them is the arc length θr, where θ is the angle ...
  35. [35]
    Why is law of cosines more preferable than haversine when ...
    Jan 6, 2011 · The simple spherical law of cosines formula ( cos c = cos a cos b + sin a sin b cos C ) gives well-conditioned results down to distances as small as around 1 ...Difference between Vincenty and great-circle distance calculations?great circle - Finding distance between two coordinates in ellipsoid?More results from gis.stackexchange.comMissing: instability | Show results with:instability
  36. [36]
    great circle - Distance between lat/long points - GIS StackExchange
    Nov 29, 2010 · In double precision the cutoff is around e = 10^-8, but by the time e = 10^-4 or so (about 10 meters) you potentially can lose so much precision ...Difference between Vincenty and great-circle distance calculations?Three different distance values, which one should I use?More results from gis.stackexchange.com
  37. [37]
    acos() bad results with two close points in C - Stack Overflow
    Dec 31, 2013 · I am making a function that calculates the distance of two points using their latitude/longitude (in degrees not radians) and the spherical law ...Missing: instability | Show results with:instability
  38. [38]
    ST_Distance - PostGIS
    Description. For geometry types returns the minimum 2D Cartesian (planar) distance between two geometries, in projected units (spatial ref units).