我已经修改了我的计算方法,以便与链接联系起来。
CLocation Coordination2Ds
double poiLon = coordinate.coordinateGeoLocation.coordinate.longitude;
double poiLat = coordinate.coordinateGeoLocation.coordinate.latitude;
double a = poiLon - self.currentLocation.coordinate.longitude;
double b = poiLat - self.currentLocation.coordinate.latitude;
poiLon=degreesToRadians(coordinate.coordinateGeoLocation.coordinate.longitude);
poiLat=degreesToRadians(coordinate.coordinateGeoLocation.coordinate.latitude);
double radCurrLatPoi=degreesToRadians(self.currentLocation.coordinate.latitude);
double radCurrLonPoi=degreesToRadians(self.currentLocation.coordinate.longitude);
a=sin(poiLon-radCurrLonPoi)*cos(poiLat);
b=cos(radCurrLatPoi)*sin(poiLat)-sin(radCurrLatPoi)*cos(poiLat)*cos(poiLon-radCurrLonPoi);
//sin(tLng-fLng)*cos(tLat), cos(fLat)*sin(tLat)-sin(fLat)*cos(tLat)*cos(tLng-fLng)
double alpha = 180.0 * atan2(a, b) / M_PI;
if (alpha < 0.0)
alpha += 360.0;
else if (alpha > 360.0)
alpha -= 360.0;
CLLocationDirection theHeading = self.currentHeading.trueHeading;
double deltaOrient = alpha - theHeading;
CGFloat X = 320.0/2.0 + (deltaOrient * 320.0f / 30.0);//x position
Note:
poiLon,poiLat -from positions in this context
radCurrLatPoi,radCurrLonPoi-To position in this context
这一点很少奏效,在这种特定情况下并不相称。
My current Location:
18.551861,73.942108
My point of Interest:
73.943202,18.552456
73.943693,18.552754
73.943275,18.552687
我认为,这可能是因为我完成了360个视角...... 任何建议