Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Great-circle distance
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Relation between central angle and chord length == The central angle <math>\Delta\sigma</math> is related with the [[Chord (geometry)|chord]] length of unit sphere <math>\Delta\sigma_\text{c}\,\!</math>: :<math>\begin{align} \Delta\sigma &= 2\arcsin \frac{\Delta\sigma_\text{c}}{2} ,\\ \Delta\sigma_\text{c} &= 2\sin \frac{\Delta\sigma}{2} . \end{align}</math> For short-distance approximation (<math>|\Delta\sigma_\text{c}| \ll 1</math>), :<math>\Delta\sigma = \Delta\sigma_\text{c} \left(1 + \frac{1}{24} \left(\Delta\sigma_\text{c}\right)^2 + \cdots \right).</math> ===Computational formulae=== On computer systems with low [[floating point]] precision, the spherical law of cosines formula can have large [[rounding error]]s if the distance is small (if the two points are a kilometer apart on the surface of the Earth, the cosine of the central angle is near 0.99999999). For modern [[IEEE 754|64-bit floating-point numbers]], the spherical law of cosines formula, given above, does not have serious rounding errors for distances larger than a few meters on the surface of the Earth.<ref>{{cite web |url=http://www.movable-type.co.uk/scripts/latlong.html |title=Calculate distance, bearing and more between Latitude/Longitude points |access-date=10 Aug 2013}}</ref> The [[haversine formula]] is [[condition number|numerically better-conditioned]] for small distances by using the chord-length relation:<ref>{{cite journal |last1=Sinnott |first1=Roger W. |title=Virtues of the Haversine |journal=Sky and Telescope |date=August 1984 |volume=68 |issue=2 |page=159}}</ref> :<math>\begin{align} \Delta\sigma &= \operatorname{archav}\left( \operatorname{hav}\left(\Delta\phi\right) + \left(1 - \operatorname{hav}(\Delta\phi) - \operatorname{hav}(\phi_1 + \phi_2)\right) \operatorname{hav}\left(\Delta\lambda\right)\right) . \end{align}</math> Historically, the use of this formula was simplified by the availability of tables for the [[haversine]] function: <math>\operatorname{hav} \theta = \sin^2 \frac{\theta}{2}</math> and <math>\operatorname{archav} x = 2 \arcsin \sqrt{x}</math>. The following shows the equivalent formula expressing the chord length explicitly: :<math>\begin{align}\Delta\sigma_\text{c}&=2\sqrt{\sin^2\left(\frac{\Delta\phi}{2}\right)+\cos{\phi_1}\cdot\cos{\phi_2}\cdot\sin^2\left(\frac{\Delta\lambda}{2}\right)} \ , \\ &=2\sqrt{\left(\sin \frac{\Delta \lambda}{2} \cos\phi_\textrm{m} \right)^2 + \left(\cos \frac{\Delta \lambda}{2} \sin \frac{\Delta \phi}{2} \right)^2} \ , \end{align}</math> where <math>\phi_\text{m}=\tfrac12(\phi_1+\phi_2)</math>. Although this formula is accurate for most distances on a sphere, it too suffers from rounding errors for the special (and somewhat unusual) case of antipodal points. A formula that is accurate for all distances is the following special case of the [[Vincenty's formulae|Vincenty formula]] for an ellipsoid with equal major and minor axes:<ref>{{cite journal |last = Vincenty |first = Thaddeus |author-link = Thaddeus Vincenty |title = Direct and Inverse Solutions of Geodesics on the Ellipsoid with Application of Nested Equations |journal = Survey Review |volume = 23 |issue = 176 |pages = 88β93 |publisher = [[Directorate of Overseas Surveys]] |location = Kingston Road, Tolworth, Surrey |date = 1975-04-01 |url =http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf |access-date = 2008-07-21 |doi = 10.1179/sre.1975.23.176.88|bibcode = 1975SurRv..23...88V }}</ref> :<math>\begin{align} \Delta\sigma = {\operatorname{atan2}} \Bigl( &\sqrt{\left( \cos\phi_2\sin\Delta\lambda\right)^2 + \left(\cos\phi_1\sin\phi_2 - \sin\phi_1\cos\phi_2\cos\Delta\lambda \right)^2}, \\ &\quad {\sin\phi_1\sin\phi_2 + \cos\phi_1\cos\phi_2\cos\Delta\lambda} \Bigr), \end{align}</math> where {{tmath|\operatorname{atan2}(y, x)}} is the [[atan2|two-argument arctangent]]. Using atan2 ensures that the correct quadrant is chosen. === Vector version === Another representation of similar formulas, but using [[n-vector|normal vectors]] instead of latitude and longitude to describe the positions, is found by means of 3D [[Vector calculus#Vector operations|vector algebra]], using the [[dot product]], [[cross product]], or a combination:<ref>{{cite journal |last1= Gade |first1= Kenneth |year= 2010 |title= A non-singular horizontal position representation |journal= The Journal of Navigation |publisher= Cambridge University Press |volume= 63 |issue= 3 |pages=395β417 |url=http://www.navlab.net/Publications/A_Nonsingular_Horizontal_Position_Representation.pdf |doi= 10.1017/S0373463309990415 |bibcode= 2010JNav...63..395G }}</ref> :<math>\begin{align} \Delta\sigma &= \arccos \left(\mathbf n_1 \cdot \mathbf n_2\right) \\ &= \arcsin \left| \mathbf n_1 \times \mathbf n_2 \right| \\ &= \arctan \frac{\left| \mathbf n_1 \times \mathbf n_2 \right|}{\mathbf n_1 \cdot \mathbf n_2} \\ \end{align}</math> where <math>\mathbf n_1</math> and <math>\mathbf n_2</math> are the normals to the sphere at the two positions 1 and 2. Similarly to the equations above based on latitude and longitude, the expression based on arctan is the only one that is [[Inverse trigonometric functions#Numerical accuracy|well-conditioned for all angles]]. The expression based on arctan requires the magnitude of the cross product over the dot product. === From chord length === A line through three-dimensional space between points of interest on a [[spherical Earth]] is the [[Chord (geometry)|chord]] of the great circle between the points. The [[central angle]] between the two points can be determined from the chord length. The great circle distance is proportional to the central angle. The great circle chord length, <math>\Delta\sigma_\text{c}\,\!</math>, may be calculated as follows for the corresponding unit sphere, by means of [[Cartesian coordinate system|Cartesian subtraction]]: :<math>\begin{align} \Delta{X} &= \cos\phi_2\cos\lambda_2 - \cos\phi_1\cos\lambda_1;\\ \Delta{Y} &= \cos\phi_2\sin\lambda_2 - \cos\phi_1\sin\lambda_1;\\ \Delta{Z} &= \sin\phi_2 - \sin\phi_1;\\ \Delta\sigma_\text{c} &= \sqrt{(\Delta{X})^2 + (\Delta{Y})^2 + (\Delta{Z})^2}. \end{align}</math> Substituting <math>\lambda_1 = -\tfrac12\Delta \lambda </math> and <math>\lambda_2 = \tfrac12 \Delta \lambda</math> this formula can be algebraically manipulated to the form shown above in {{slink||Computational formulae}}.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)