2012-08-04 19 views
6

की दिशा बताने के लिए मैं 3 भू अंककैसे दो भू अंक

(स्थिति शुरू) 11.986242477259117 है, 79.84657287597656`

(मध्य स्थिति) 11.984521304799278, 79,84583258628845

(अंत स्थिति) 11.985014568760436, 79,844491481781

मैं से How to draw a path on a map using kml file?

ज्ञान प्राप्त है और मैं भू के बीच की रेखा drawed गए अंक इसे पसंद करते हैं।

enter image description here

मैं दूरी का उपयोग कर की गणना है How to calculate distance between two locations using their longitude and latitude value

मेरा प्रश्न है जब उपयोगकर्ता 'ए' (स्थिति शुरू), मैं दिशा बताना चाहता हूँ, आप के लिए कदम हवलदार "पर के पास खड़ा है, उत्तर "," पूर्व "," पश्चिम "," दक्षिण "इस तरह।

यदि उपयोगकर्ता गलत दिशा से आगे बढ़ता है, तो आपको "गलत दिशा चलाना है" और सही दिशा कहने की आवश्यकता है।

दो भू बिंदुओं के बीच दिशा कैसे प्राप्त करें।

मैं Get direction (compass) with two longitude/latitude points

से degee यह कुछ हद रिटर्न मिलता है, पर मैं सही दिशा बताने के लिए unbale हूँ।

दो भू बिंदुओं के बीच दिशा कैसे प्राप्त करें।

+0

एक नजर डालें @ http://stackoverflow.com/questions/3209899/determine-compass-direction -से-एक अक्षांश-देशांतर करने वाली-अन्य – cklab

उत्तर

2

जांच इस विधि अगर यह आपकी मदद कर सकते हैं:

location.getBearing() 

Returns the direction of travel in degrees East of true North. If hasBearing() is false, 0.0 is returned.

इस विधि या डिवाइस की दिशा प्राप्त करने के लिए सेंसर का प्रयोग करें।

उसके बाद का उपयोग कर इस डिग्री में अपने दो अंक की दिशा मिलती है:

location.bearingTo(dest) 

Returns the approximate initial bearing in degrees East of true North when traveling along the shortest path between this location and the given location. The shortest path is defined using the WGS84 ellipsoid. Locations that are (nearly) antipodal may produce meaningless results.

संबंधित मुद्दे