क्या आपने इसे हल किया है? अन्यथा आप दूरस्थ स्थान के एजीमुथ कोण की गणना कर सकते हैं। सबसे पहले चुंबकीय उत्तर शीर्षक के साथ और फिर सही उत्तर शीर्षक के साथ। अंत में आप चुंबकीय विचलन प्राप्त करने के लिए दोनों को घटाएं।
यहाँ कैसे एक दूरस्थ स्थान के लिए एक दिगंश कोण की गणना करने के लिए है:
-(float)azimuthFromLocations:(CLLocationCoordinate2D)first toCoordinate:(CLLocationCoordinate2D)second{
float longitudeDifference = second.longitude - first.longitude;
float latitudeDifference = second.latitude - first.latitude;
float possibleAzimuth = (M_PI * .5f) - atan(latitudeDifference/longitudeDifference);
if (longitudeDifference > 0)
return possibleAzimuth;
else if (longitudeDifference < 0)
return possibleAzimuth + M_PI;
else if (latitudeDifference < 0)
return M_PI;
return 0.0f;
}
स्रोत
2012-11-14 22:44:17
मेरे विचारों में से एक यह सीएलएलोकेशन की स्थान संपत्ति को लिखना था, लेकिन यह पूरी तरह से पढ़ा गया, ताकि खिड़की से बाहर हो। –