Calculating angle between two vectors?
I'm developing an iOS app, which has to show POIs (points of interest) depending on device heading. I used CLLocationManager to get user's location and heading. I have one pair of destination's coordinates. Based on this I'm calculating which quarter is that and returning float value of deviation from south (0 degrees) in degrees. I have -/+180 degrees in the north and 0 in the south. Here is code snippet: -(float)updateTargetLongitude:(float)lon Latitude:(float)lat{ // //longitude = x // //latitude = y NSLog(@"current location = (%.5f, %.5f)", [[NSUserDefaults standardUserDefaults]