地理算法,用于通过距离和方位角从已知位置查找点的坐标 [英] Geoalgorithm for finding coordinates of point from a known location by distance and bearing
问题描述
我想使用Google Maps静态API来显示带有指示边界的路径叠加的地图。
I'd like to use Google maps static API to display a map with a path overlay indicating a boundary.
AFAICT该静态API不支持多边形,因此,我打算通过使用路径绘制边界来避免这种情况。
AFAICT the static API doesn't support polygons, so I intend to circumvent this by drawing the boundary using paths.
为此,我需要确定在两点之间绘制直线(路径)的点;所以我想要一种算法,该算法可以返回地理位置(即WGS84坐标)到已知点的给定方位角和距离。
To do this I need to determine the points to draw the straight lines (paths) between; so I'd like an algorithm that returns the geographic location (i.e. WGS84 coordinates) a given bearing and distance from a known point.
有人可以指出我这种算法吗? 。最好使用C#,但可以接受其他语言?
Can anyone point me to such an algorithm. Preferably in C#, but other languages are acceptable?
推荐答案
找到了此方法(在这里: http://williams.best.vwh.net/avform.htm#LL ):
Found this (here: http://williams.best.vwh.net/avform.htm#LL):
如果满足以下条件,则点{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
半径将以弧度还是弧度表示?
Will the radial be in radians or degrees?
编辑:
弧度=度* PI / 180
radians = degrees * PI / 180
这篇关于地理算法,用于通过距离和方位角从已知位置查找点的坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!