由於經緯度的計算不是用平面座標而是用球面座標,所以用經緯度計算兩點間直線距離是計算球面上兩點間最短的距離,又稱為大圓距離 (The Great Circle Distance)。
因此用 "大圓距離" 才能搜尋到正確公式。
下列公式是考慮地球為圓球體的計算公式。
◎若已知兩點之經緯度,可用下列公式求出大圓距離:
Great-circle distance 公式
![](https://pic.pimg.tw/wywu/1452253585-3370913020.png)
Haversine 公式
![](https://pic.pimg.tw/wywu/1452253585-2168622297.png)
可參考維基百科上的資料:
Great-circle distance
Haversine formula
◎若已知兩點之經緯度,可用下列公式求出
點 1 到點 2 之起始方位角 (initial bearing)
![](https://pic.pimg.tw/wywu/1452253585-3091718376.png)
![](https://pic.pimg.tw/wywu/1452253585-2942295040.png)
![](https://pic.pimg.tw/wywu/1452253585-825754864.png)
◎若已知點 1 之經緯度和到點 2 之距離
![](https://pic.pimg.tw/wywu/1452253585-374076676.png)
![](https://pic.pimg.tw/wywu/1452253584-150799494.png)
![](https://pic.pimg.tw/wywu/1452253584-1736676331.png)
其中
![](https://pic.pimg.tw/wywu/1452253585-374076676.png)
![](https://pic.pimg.tw/wywu/1452253584-542487396.png)
![](https://pic.pimg.tw/wywu/1452253584-1207402046.png)
![](https://pic.pimg.tw/wywu/1452253584-1060192014.png)
其實這只是球面三角餘弦公式的推廣,注意經緯度的度數計算時要轉成弳度,才會計算正確。
下一篇:經緯度計算距離公式 (2)
全站熱搜