Location Pointer and Distance Calculation
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
精彩评论