且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从旧 + n 米计算新的经度、纬度

更新时间:2023-12-04 13:05:40

每度经度的公里数约为

(pi/180) * r_earth * cos(theta*pi/180)

其中 theta 是以度为单位的纬度,r_earth 约为 6378 公里.

where theta is the latitude in degrees and r_earth is approximately 6378 km.

所有地点每纬度的公里数大致相同,大约

The number of kilometers per degree of latitude is approximately the same at all locations, approx

(pi/180) * r_earth = 111 km / degree 

所以你可以这样做:

new_latitude  = latitude  + (dy / r_earth) * (180 / pi);
new_longitude = longitude + (dx / r_earth) * (180 / pi) / cos(latitude * pi/180);

只要 dxdy 与地球的半径相比很小,并且您不会离两极太近.

As long as dx and dy are small compared to the radius of the earth and you don't get too close to the poles.