views:

260

answers:

1

Hi,

I'm attempting to find the euclidean distance in meters between two points on an MKMapView using iPhone OS 3.2. The problem is that I have these coordinates in terms of latitude and longitude, which, mathematically provides me enough data to find the distance, but it's going to take some tricky trigonometry. Is there any simpler solution?

Thanks!

+2  A: 

CLLocation has a method to calculate the distance for you:

- (CLLocationDistance)distanceFromLocation:(const CLLocation *)location

API docs here.

pgb
Wow thanks! You are my hero for today.
mag725