I need to know how to calculate some sort of perimeter around a lat/long coordinate (in a floating point number) in an "if" statement that looks somewhat like this:
if (lat != perimeterLat && long != perimeterLong) {
// alert
}
If there is a better way of doing this (instead of using an "if" statement) please let me know.
Thanks, Jacob Cross
UPDATE:
Ok. So I figured it out. What I am going to do is this:
- (void)locationChange:(CLLocation *)newLocation:(CLLocation *)oldLocation {
CLLocationCoordinate2D newCoordinate = [newLocation coordinate];
CLLocationCoordinate2D oldCoordinate = [oldLocation coordinate];
CLLocationDistance meters = [newCoordinate distanceFromLocation:oldLocation];
}
And that is going to be how I figure out the distance away.
Thanks for everyone's help!