【发布时间】:2011-10-18 23:29:52
【问题描述】:
这是计算从一个 CLLocation 到另一个的角度(以弧度为单位)的有效方法吗?
-(float)angleFromLocation:(CLLocationCoordinate2D)start toLocation:(CLLocationCoordinate2D)end {
float deltaX = start.latitude - end.latitude;
float deltaY = start.longitude - end.longitude;
float ang = atan2(deltaY, deltaX);
return ang;}
请指教!
任何帮助将不胜感激。
【问题讨论】:
-
你已经接近了。查看此答案的解决方案 - stackoverflow.com/questions/6140045/…
标签: coordinates core-location augmented-reality angle