Geographical distance
Introduction
Calculating the distance between geographical coordinates is based on some level of abstraction; it does not provide an exact distance, which is unattainable if one attempted to account for every irregularity in the surface of the earth.[1] Common abstractions for the surface between two geographic points are:
- Flat surface;
- Spherical surface;
- Ellipsoidal surface.
All abstractions above ignore changes in elevation. Calculation of distances which account for changes in elevation relative to the idealized surface are not discussed in this article.
Nomenclature
Distance,
is calculated between two points,
and
. The geographical coordinates of the two points, as (latitude, longitude) pairs, are
and
respectively. Which of the two points is designated as
is not important for the calculation of distance.
Latitude and longitude coordinates on maps are usually expressed in degrees. In the given forms of the formulae below, one or more values must be expressed in the specified units to obtain the correct result. Where geographic coordinates are used as the argument of a trigonometric function, the values may be expressed in any angular units compatible with the method used to determine the value of the trigonometric function. Many electronic calculators allow calculations of trigonometric functions in either degrees or radians. The calculator mode must be compatible with the units used for geometric coordinates.
Differences in latitude and longitude are labeled and calculated as follows:
It is not important whether the result is positive or negative when used in the formulae below.
"Mean latitude" is labeled and calculated as follows:
Colatitude is labeled and calculated as follows:
- For latitudes expressed in radians:
- For latitudes expressed in degrees:
Unless specified otherwise, the radius of the earth for the calculations below is:
= 6,371.009 kilometers = 3,958.761 statute miles = 3,440.069 nautical miles.
= Distance between the two points, as measured along the surface of the earth and in the same units as the value used for radius unless specified otherwise.
Singularities and discontinuity of latitude/longitude
Longitude has singularities at the Poles (longitude is undefined) and a discontinuity at the ±180° meridian. Also, planar projections of the circles of constant latitude are highly curved near the Poles. Hence, the above equations for delta latitude/longitude (
,
) and mean latitude (
) may not give the expected answer for positions near the Poles or the ±180° meridian. Consider e.g. the value of
(“east displacement”) when
and
are on either side of the ±180° meridian, or the value of
(“mean latitude”) for the two positions (
=89°,
=45°) and (
=89°,
=−135°).
If a calculation based on latitude/longitude should be valid for all Earth positions, it should be verified that the discontinuity and the Poles are handled correctly. Another solution is to use n-vector instead of latitude/longitude, since this representation does not have discontinuities or singularities.
Flat-surface formulae
A planar approximation for the surface of the earth may be useful over small distances. The accuracy of distance calculations using this approximation become increasingly inaccurate as:
- The separation between the points becomes greater;
- A point becomes closer to a geographic pole.
The shortest distance between two points in plane is a straight line. The Pythagorean theorem is used to calculate the distance between points in a plane.
Even over short distances, the accuracy of geographic distance calculations which assume a flat Earth depend on the method by which the latitude and longitude coordinates have been projected onto the plane. The projection of latitude and longitude coordinates onto a plane is the realm of cartography.
The formulae presented in this section provide varying degrees of accuracy.
Spherical Earth projected to a plane
This formula takes into account the variation in distance between meridians with latitude:

- where:
and
are in radians;
must be in units compatible with the method used for determining 
- To convert latitude or longitude to radians use
- Note: This approximation is very fast and produces fairly accurate result for small distances[citation needed]. Also, when ordering locations by distance, such as in a database query, it is much faster to order by squared distance, eliminating the need for computing the square root.
Ellipsoidal Earth projected to a plane
The FCC prescribes essentially the following formulae in 47 CFR 73.208 for distances not exceeding 475 km /295 miles:[2]

- where
= Distance in kilometers;
and
are in degrees;
must be in units compatible with the method used for determining 

- It may be interesting to note that:
= kilometers per degree of latitude difference;
= kilometers per degree of longitude difference;- where
and
are the meridional and its perpendicular, or "normal", radii of curvature (the expressions in the FCC formula are derived from the binomial series expansion form of
and
, set to the Clarke 1866 reference ellipsoid).
Polar coordinate flat-Earth formula

- where the colatitude values are in radians. For a latitude measured in degrees, the colatitude in radians may be calculated as follows:

Spherical-surface formulae
If we are willing to accept a possible error of 0.5%, we can use formulas of spherical trigonometry on the sphere that best approximates the surface of the earth.
The shortest distance along the surface of a sphere between two points on the surface is along the great-circle which contains the two points.
The great-circle distance article gives the formula for calculating the distance along a great-circle on a sphere about the size of the Earth. That article includes an example of the calculation.
Tunnel distance
A tunnel between points on Earth is defined by a line through three-dimensional space between the points of interest. The great circle chord length may be calculated as follows for the corresponding unit sphere:
The tunnel distance between points on the surface of a spherical Earth is
. For short distances (
), this underestimates the great circle distance by
.
Ellipsoidal-surface formulae
An ellipsoid approximates the surface of the earth much better than a sphere or a flat surface does. The shortest distance along the surface of an ellipsoid between two points on the surface is along the geodesic. Geodesics follow more complicated paths than great circles and in particular, they usually don't return to their starting positions after one circuit of the earth. This is illustrated in the figure on the right where f is taken to be 1/50 to accentuate the effect. Finding the geodesic between two points on the earth, the so-called inverse geodetic problem, was the focus of many mathematicians and geodesists over the course of the 18th and 19th centuries with major contributions by Clairaut,[3] Legendre,[4] Bessel,[5] and Helmert.[6] Rapp[7] provides a good summary of this work.
Methods for computing the geodesic distance are widely available in geographical information systems, software libraries, standalone utilities, and online tools. The most widely used algorithm is by Vincenty,[8] who uses a series which is accurate to third order in the flattening of the ellipsoid, i.e., about 0.5 mm; however, the algorithm fails to converge for points that are nearly anti-podal. (For details, see Vincenty's formulae.) This defect is cured in the algorithm given by Karney,[9] who employs series which are accurate to sixth order in the flattening. This results in an algorithm which is accurate to full double precision and which converges for arbitrary pairs of points on the earth. This algorithm is implemented in GeographicLib.[10]
The exact methods above are feasible when carrying out calculations on a computer. They are intended to give millimeter accuracy on lines of any length; we can use simpler formulas if we don't need millimeter accuracy, or if we do need millimeter accuracy but the line is short. Rapp,[11] Chap. 6, describes the Puissant method, the Gauss mid-latitude method, and the Bowring method.[12]
Lambert's formula for long lines
Lambert's formulae[13] give accuracy on the order of 10 meters over thousands of kilometers. First convert the latitudes
,
of the two points to reduced latitudes
, 

where
is the flattening. Then calculate the central angle
in radians between two points
and
on a sphere in the usual way (law of cosines or haversine formula), with longitudes
and
being the same on the sphere as on the spheroid.



where
is the equatorial radius of the chosen spheroid.
On the GRS 80 spheroid Lambert's formula is off by
- 0 North 0 West to 40 North 120 West, 12.6 meters
- 0N 0W to 40N 60W, 6.6 meters
- 40N 0W to 40N 60W, 0.85 meter
Bowring's method for short lines
Bowring maps the points to a sphere of radius R′, with latitude and longitude represented as φ′ and λ′. Define
where the second eccentricity squared is
The spherical radius is
(The Gaussian curvature of the ellipsoid at φ1 is 1/R′2.) The spherical coordinates are given by
where
,
,
,
. The resulting problem on the sphere may be solved using the techniques for great-circle navigation to give approximations for the spheroidal distance and bearing. Detailed formulas are given by Rapp,[11] §6.5 and Bowring.[12]
See also
- Earth radius
- Spherical Earth
- Great-circle distance
- Great-circle navigation
- Vincenty's formulae
- Meridian arc
References
- http://www.cartography.org.uk/default.asp?contentID=749
- http://edocket.access.gpo.gov/cfr_2005/octqtr/pdf/47cfr73.208.pdf
- Clairaut, A. C. (1735). "Détermination géometrique de la perpendiculaire à la méridienne tracée par M. Cassini" [Geometrical determination of the perpendicular to the meridian drawn by Jacques Cassini]. Mémoires de l'Académie Royale des Sciences de Paris 1733 (in French): 406–416.
- Legendre, A. M. (1806). "Analyse des triangles tracées sur la surface d'un sphéroïde" [Analysis of spheroidal triangles]. Mémoires de l'Institut National de France (in French) (1st semester): 130–161.
- Bessel, F. W. (2010) [1825]. . Translated by C. F. F. Karney & R. E. Deakin. "The calculation of longitude and latitude from geodesic measurements". Astronomische Nachrichten 331 (8): 852–861. arXiv:0908.1824. doi:10.1002/asna.201011352. English translation of Astron. Nachr. 4, 241–254 (1825). Errata.
- Helmert, F. R. (1964) [1880]. Mathematical and Physical Theories of Higher Geodesy 1. St. Louis: Aeronautical Chart and Information Center. English translation of Die Mathematischen und Physikalischen Theorieen der Höheren Geodäsie, Vol. 1 (Teubner, Leipzig, 1880).
- Rapp, R. H. (March 1993). Geometric Geodesy, Part II (Technical report). Ohio State University. Retrieved 2011-08-01.
- Vincenty, T. (April 1975). "Direct and Inverse Solutions of Geodesics on the Ellipsoid with application of nested equations" (PDF). Survey Review 23 (176): 88–93. doi:10.1179/sre.1975.23.176.88. Retrieved 2009-07-11. Addendum: Survey Review 23 (180): 294 (1976).
- Karney, C. F. F. (2013). "Algorithms for geodesics". Journal of Geodesy 87 (1): 43–42. arXiv:1109.4448. Bibcode:2013JGeod..87...43K. doi:10.1007/s00190-012-0578-z (open access). Addenda.
- Karney, C. F. F. (2013). "GeographicLib". 1.32.
- Rapp, R, H, (1991). Geometric Geodesy, Part I (Report). Ohio Start Univ.
- Bowring, B. R. (1981). "The direct and inverse problems for short geodesics lines on the ellipsoid". Surveying and Mapping 41 (2): 135–141.
- Lambert, W. D (1942). "The distance between two widely separated points on the surface of the earth". J. Washington Academy of Sciences 32 (5): 125–130.
External links
- Ivis, Frank (2006). "Calculating Geographic Distance: Concepts and Methods" (PDF).
- An online geodesic calculator (based on GeographicLib).
- An online geodesic bibliography.
- Tripstance tool - Online distance calculator.
- Online Distance Calculator Tool - road distance calculator.
Geographical distance的更多相关文章
- Family Gathering at Christmas(思维题)
Family Gathering at Christmas 时间限制: 1 Sec 内存限制: 128 MB提交: 13 解决: 4[提交] [状态] [讨论版] [命题人:admin] 题目描述 ...
- POJ 2254 Globetrotter (计算几何 - 球面最短距离)
题目链接:POJ 2254 Description As a member of an ACM programming team you'll soon find yourself always tr ...
- [LeetCode] Total Hamming Distance 全部汉明距离
The Hamming distance between two integers is the number of positions at which the corresponding bits ...
- [LeetCode] Hamming Distance 汉明距离
The Hamming distance between two integers is the number of positions at which the corresponding bits ...
- [LeetCode] Rearrange String k Distance Apart 按距离为k隔离重排字符串
Given a non-empty string str and an integer k, rearrange the string such that the same characters ar ...
- [LeetCode] Shortest Distance from All Buildings 建筑物的最短距离
You want to build a house on an empty land which reaches all buildings in the shortest amount of dis ...
- [LeetCode] Shortest Word Distance III 最短单词距离之三
This is a follow up of Shortest Word Distance. The only difference is now word1 could be the same as ...
- [LeetCode] Shortest Word Distance II 最短单词距离之二
This is a follow up of Shortest Word Distance. The only difference is now you are given the list of ...
- [LeetCode] Shortest Word Distance 最短单词距离
Given a list of words and two words word1 and word2, return the shortest distance between these two ...
随机推荐
- Oracle 学习----:创建表(主键自增)
一.创建表 create table testTable ( Id numbere, name varchar2(100), age number, createTime date, primary ...
- ACM-ICPC 2018 焦作赛区网络预赛
这场打得还是比较爽的,但是队友差一点就再过一题,还是难受啊. 每天都有新的难过 A. Magic Mirror Jessie has a magic mirror. Every morning she ...
- 【homework week5】初步了解敏捷开发——自由与约束的哲学统一
“自由与束缚的哲学统一”或许不该放到标题上去,毕竟它只是我灵光一闪的感悟.但这个spark让我感到高中到大学的哲学应该也没有白学,这是让人非常兴奋的一件事. 所以我还是把它放到了标题上. 来谈敏捷软件 ...
- 平时代码中不符合python风格的举例
良好的代码风格体现出自己的专业,良好的代码风格,方便同事之间协作. 下面举例讲讲自己在代码中不符合python风格的一些情况,方便自己写出优雅的代码. 段落之间空两行 很长的参数用括号连接但是不要超过 ...
- nyoj 题目5 Binary String Matching
Binary String Matching 时间限制:3000 ms | 内存限制:65535 KB 难度:3 描述 Given two strings A and B, whose alp ...
- Linux抓包工具tcpdump命令详解
1.简介 用简单的话来定义tcpdump,就是:dump the traffic on a network,根据使用者的定义对网络上的数据包进行截获的包分析工具. tcpdump可以将网络中 ...
- Git详解之二 Git基础 转
http://www.open-open.com/lib/view/open1328069733264.html Git 基础 读完本章你就能上手使用 Git 了.本章将介绍几个最基本的,也是最常用的 ...
- openssl-1.0.1c交叉编译动态库(转)
linux编译相关(13) 版权声明:本文为博主原创文章,未经博主允许不得转载. #交叉编译openssl ------直接修改Makefile新加这一行:CROSS_COMPILE= arm-un ...
- 一个javascript继承和使用的例子
继承可以帮助我们实现代码的重用,把对象的属性写入构造函数,对象的方法写入原型后,以下例子演示继承的使用: 示例的css和js在后 父实例,得到一个间隔1s的轮播: <!DOCTYPE html& ...
- react之只用classNames避免字符串拼接
之前在react当中使用了字符串拼接的方式来拼接类名的字符串,这种方法不仅不够方便,还会出现很多问题 使用classNames这个工具,可以省去拼接字符串的烦恼,大大提高开发效率 首先,最简单的使用方 ...









