views:

83

answers:

2

Hi,

I have my current location from CLLocation,

and I have another location- also an CLLocation.

I would like to detect when my device is heading towards that other location.

(I can calculate the distance in meters between this points- but can't workout

the calculation of an accurate angle to compare with the device current heading)

Thanks.

A: 

How about using CLLocation's built-in course property?

Ole Begemann
Thanks but how?
Tiger
How can I define the point to wich I want to find the course?
Tiger
A: 

To Be deleted

One approach could be to continuously calculate the distance between current location and target location. if the distance decreases, your device is moving towards the the target.


In a real world szenario (car in city, car in mountainous country e.g. Switzerland) this doesn't work. You would need some array of way-points (e.g. intersections) that lead towards the target and continuosly look for the closest waypoint.

lexu
The device is not moving-I have 2 locations- the devices location and the other one-I need to know when the device is heading (not moving towards- just heading) towards that point.
Tiger
Aha. Language issue, I guess. In this context my answer makes zero sense. I'll mark it as wiki and delete, once you had a chance to read this.
lexu
Thanks,Is this "azimuth" that I am looking for?
Tiger