2012-04-15 56 views
0

我试图确定距离另一个位置有一定距离的位置。我在iOS中使用CoreLocation的纬度和经度。CoreLocation从坐标获得一定距离和方向的经度和纬度

谢谢。

+0

不知道该如何回答。我一整天都在阅读iOS SDK文档。我还读过这个http://janmatuschek.de/LitudeitudeLounditudeBoundingCoordinates,它与另一个问题有关。远远的,我很难过。 – Jenn 2012-04-15 22:28:20

回答

0
lat2 = asin(sin(lat1)*cos(d/R) + cos(lat1)*sin(d/R)*cos(θ)) 
lon2 = lon1 + atan2(sin(θ)*sin(d/R)*cos(lat1), cos(d/R)−sin(lat1)*sin(lat2)) 

R是地球的半径在你的首选单位。 (6371 in km)

+0

请您详细说明。什么是d和R?我认为R是球体的半径。我在哪里应用我想从第一点开始衡量的方向?编辑:我GOOGLE了公式,发现这个网页http://www.movable-type.co.uk/scripts/latlong.html – Jenn 2012-04-15 22:32:30

+0

'D'是行驶的距离。 “θ”是标题。 – 2012-04-15 22:34:41

+0

谢谢。我会标记它的答案 – Jenn 2012-04-15 22:35:45

相关问题