我需要计算当前位置(通过获取纬度,来自GPS的经度)和指定(mecca [mosque])之间的距离,该距离是固定的。请有人指导我。
- 提前谢谢。
答案 0 :(得分:2)
利用
[location1 distanceFromLocation:location2];
在你的情况下
[currentLocation distanceFromLocation:meccaLocation];
请注意,这会返回CLLocationDistance
答案 1 :(得分:0)
http://www.movable-type.co.uk/scripts/latlong.html
对该主题的优秀报道。
其他详细信息请参见Bowditch的 American Practical Navigator 。
这可能有助于了解这一点:21°25'36“N / 39°49'34”E