I would like to find the distance to a location and which direction the device is heading in relation to that location. I've got the distance working but cant work out how to find the which way the location.
_theLocation = [[CLLocation alloc]initWithLatitude:-41.561004 longitude:173.849030];
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
CLLocationDistance meters = [newLocation distanceFromLocation:_theLocation] * 0.000621371192;
}
- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
{
NSString *str = [NSString stringWithFormat:@"Heading = %.f", newHeading.trueHeading];
}
Is it possible to find the heading to _theLocation
from our location?