0

给定两个gps坐标,可以使用haversine公式计算长度差。但是反过来呢:

  • 计算给定 Lat/Long double 的长度差(以米为单位)

  • 计算给定长度(以米为单位)的 Lat/Long 双精度

我知道这并不完全可能,因为它与你在地球上的点不同,但有可能近似这个或类似的东西吗?这不必非常精确。

4

1 回答 1

0

如果您的位移不是太大(小于几公里),请使用快速而肮脏的估计,即 y 方向的 111,111 米是 1 度(纬度),x 方向的 111,111 * cos(纬度)米是 1度数(经度)。

或者:

//Position, decimal degrees
 lat = 51.0
 lon = 0.0

 //Earth’s radius, sphere
 R=6378137

 //offsets in meters
 distanceNorth = 100
 distanceEast = 100

 //Coordinate offsets in radians
 dLat = distanceNorth/R
 dLon = distanceEast/(R*Cos(Pi*lat/180))

 //OffsetPosition, decimal degrees
 latO = lat + dLat * 180/Pi
 lonO = lon + dLon * 180/Pi 
This should return:

 latO = 51,00089832
 lonO = 0,001427437
于 2012-06-14T21:10:08.580 回答