Calculating bearing between two CLLocationCoordinate2Ds
问题 Very \"simple\" problem: given two CLLocationCoordinate2Ds, how can I get the bearing (as radians) from the first to the second? I\'ve done a lot of research and studying on this, both the general problem and Objective-C/Cocoa Touch/iOS specifically. Here\'s my implementation: - (float) getHeadingForDirectionFromCoordinate:(CLLocationCoordinate2D)fromLoc toCoordinate:(CLLocationCoordinate2D)toLoc { float fLat = fromLoc.latitude; float fLng = fromLoc.longitude; float tLat = toLoc.latitude;