Formula/algorithm 偏移 GPS 坐标

Formula/algorithm to offset GPS coordinations

我有 GPS 坐标以纬度、经度的形式提供,我想将它们偏移一个距离和一个角度。

例如:如果我偏移 45.12345,新坐标是什么,7.34567 沿方位角 104 度 22 公里?

谢谢

对于大多数应用,这两个公式之一就足够了:

"Lat/lon given radial and distance"

第二个速度较慢,但​​在特殊情况下问题较少(请参阅该页面上的文档)。
阅读该页面上的介绍,并确保 lat/lon 在得到结果之前转换为弧度并返回度数。 确保您的系统使用 atan2(y,x)(通常是这种情况)而不是 Excell 中的 atan2(x,y)。

之前回答的link已经失效了,这里是link使用返程机:

https://web.archive.org/web/20161209044600/http://williams.best.vwh.net/avform.htm

公式为:

点 {lat,lon} 是 tc 径向距离点 1 的距离 d,如果:

 lat=asin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos(tc))
 IF (cos(lat)=0)
    lon=lon1      // endpoint a pole
 ELSE
    lon=mod(lon1-asin(sin(tc)*sin(d)/cos(lat))+pi,2*pi)-pi
 ENDIF

此算法仅限于 dlon

 lat =asin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos(tc))
 dlon=atan2(sin(tc)*sin(d)*cos(lat1),cos(d)-sin(lat1)*sin(lat))
 lon=mod( lon1-dlon +pi,2*pi )-pi