经纬度距离计算器
本经纬度距离计算器使用 Haversine 公式计算地球表面两个 GPS 坐标之间的大圆距离。输入两个位置的纬度和经度,获取以千米、英里和海里表示的距离,以及初始方位角和地理中点。
Lat Long Distance Calculator
Calculate the shortest distance between two points on Earth's surface
Use N/S for latitude and E/W for longitude directions
Point 1
Point 2
常见问题
如何根据经纬度计算两点间的距离?
最常用的方法是 Haversine 公式,它考虑了地球的球形曲率,计算地球表面两点之间的大圆距离。公式为:d = 2R × arcsin(√(sin²(Δφ/2) + cos(φ₁)·cos(φ₂)·sin²(Δλ/2))),其中 R 为地球半径(6371 km)。
经纬度坐标格式有哪些?
经纬度有三种常见格式:①十进制度数(DD):如 40.7128°N;②度分秒(DMS):如 40°42'46"N;③度十进制分(DM):如 40°42.767'N。本计算器支持所有格式输入,并自动换算。
Haversine 公式和文森特公式有什么区别?
Haversine 公式将地球视为完美球体,计算误差约 0.5%;文森特公式(Vincenty Formula)考虑地球椭球体形状,精度更高,误差小于 0.5mm,适用于精密导航和测绘。本计算器使用 Haversine 公式,对于大多数应用场景已足够精确。
如何输入负数坐标?
南纬用负数表示(如南纬 33.87° = -33.87),西经用负数表示(如西经 151.21° = -151.21)。或者直接选择 S(南)/ W(西)方向。例如,悉尼坐标:-33.87°, 151.21°(或 33.87°S, 151.21°E)。
Related Calculators
- 3D Distance Calculator — Calculate distance between two points in 3D space
- 2D Distance Calculator — Euclidean distance between two points on a plane
- Scale Factor Calculator — Convert between map and real-world distances
What Is Latitude and Longitude?
Latitude and longitude form a geographic coordinate system that uniquely identifies every point on Earth. Latitude measures the north-south position, ranging from -90° (South Pole) to +90° (North Pole), with 0° at the equator. Longitudemeasures the east-west position, ranging from -180° to +180°, with 0° at the Prime Meridian (Greenwich, England). Together, a latitude-longitude pair pinpoints any location on the globe with sub-meter precision when enough decimal places are used. GPS devices, mapping applications, and surveying equipment all rely on this coordinate system.
The Haversine Formula
The Haversine formula calculates the great-circle distancebetween two points on a sphere, which is the shortest path along the surface. It uses the "haversine" function, hav(θ) = sin²(θ/2), and is defined as:
a = sin²(Δφ/2) + cos(φ₁) · cos(φ₂) · sin²(Δλ/2)
d = 2R · arctan2(√a, √(1-a))
where φ₁ and φ₂ are the latitudes in radians, Δφ is the latitude difference, Δλ is the longitude difference, and R is Earth's mean radius (6,371 km). The Haversine formula is numerically stable even for small distances, which makes it superior to the spherical law of cosines for GPS applications. It was historically important for maritime navigation and remains the standard method for computing distances between coordinates.
Haversine vs Vincenty: Accuracy Comparison
Two main formulas are used for geodesic distance calculations. The choice depends on the accuracy requirements of your application.
| Method | Earth Model | Accuracy | Speed | Best For |
|---|---|---|---|---|
| Haversine | Perfect sphere (R = 6,371 km) | ~0.5% (up to ~30 km error on long distances) | Very fast | Navigation, travel planning, general use |
| Vincenty | WGS-84 oblate spheroid | ~0.5 mm | Iterative (slower) | Surveying, geodesy, high-precision mapping |
For most practical purposes, the Haversine formula provides sufficient accuracy. The Vincenty formula is necessary only when sub-meter precision is required, such as in land surveying, geodetic reference networks, and precision mapping.
How to Calculate Distance Between Coordinates
Here is a worked example calculating the distance from New York City (40.7128°N, 74.0060°W) to London(51.5074°N, 0.1278°W).
- Convert to radians:φ₁ = 40.7128° × π/180 = 0.7106 rad, φ₂ = 51.5074° × π/180 = 0.8989 rad, Δφ = 0.1883 rad, Δλ = 1.2891 rad
- Compute a:a = sin²(0.0942) + cos(0.7106) · cos(0.8989) · sin²(0.6446) = 0.0089 + 0.7597 × 0.6266 × 0.3625 = 0.1812
- Compute c:c = 2 · arctan2(√0.1812, √0.8188) = 0.8742 rad
- Compute distance: d = 6,371 × 0.8742 = 5,567 km (3,459 miles)
The actual flight distance from New York to London is approximately 5,570 km, confirming the Haversine formula's accuracy for this route.
Coordinate Formats: Decimal vs DMS
Geographic coordinates can be expressed in two common formats: decimal degrees (DD) and degrees-minutes-seconds (DMS).
Conversion formula (DMS to Decimal):
Example: 40°26'46"N = 40 + 26/60 + 46/3600 = 40.4461°
South latitudes and West longitudes are negative: 73°59'0"W = -(73 + 59/60 + 0/3600) = -73.9833°
Most GPS devices and mapping APIs use decimal degrees. DMS notation is still common on paper maps and in traditional navigation. Our calculator accepts both formats, converting automatically for accurate distance computation.
Common City-Pair Distances
Reference distances between major world cities, calculated using the Haversine formula.
| From | To | Distance (km) | Distance (mi) | Initial Bearing |
|---|---|---|---|---|
| New York | London | 5,570 | 3,461 | 51° |
| Los Angeles | Tokyo | 8,815 | 5,478 | 305° |
| Sydney | Singapore | 6,288 | 3,907 | 335° |
| Dubai | Mumbai | 1,926 | 1,197 | 104° |
| São Paulo | Cape Town | 6,810 | 4,231 | 133° |
| Paris | Moscow | 2,486 | 1,544 | 61° |
| Beijing | Berlin | 7,354 | 4,569 | 329° |
| Cairo | Rome | 2,131 | 1,324 | 318° |
Related Tools
- 3D Distance Calculator — Calculate distance between two points in 3D space
- 2D Distance Calculator — Euclidean distance between two points on a plane
- Scale Factor Calculator — Convert between map and real-world distances