开发者

Location Pointer and Distance Calculation

开发者 https://www.devze.com 2023-03-03 07:04 出处:网络
I need to calculate the开发者_如何学C distance between the current location(by getting latitude,longitude from GPS) and designation (mecca[mosque]) which is fixed. Please anyone guide me.

I need to calculate the开发者_如何学C distance between the current location(by getting latitude,longitude from GPS) and designation (mecca[mosque]) which is fixed. Please anyone guide me.

-Thanks in Advance.


Make use of

 [location1 distanceFromLocation:location2];

In your case

[currentLocation distanceFromLocation:meccaLocation];

Note that this returns the distance in CLLocationDistance


http://www.movable-type.co.uk/scripts/latlong.html

Excellent coverage of the subject.

Additional details are in Bowditch's American Practical Navigator.

And it may help to know this: 21° 25' 36" N / 39° 49' 34" E

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号