2011-07-28 25 views

回答

0
θ is the bearing (in radians, clockwise from north); 
d/R is the angular distance (in radians), where d is the distance travelled and R is the earth’s radius 

源:http://www.movable-type.co.uk/scripts/latlong.html

var lat2 = Math.asin(Math.sin(lat1)*Math.cos(d/R) + 
         Math.cos(lat1)*Math.sin(d/R)*Math.cos(brng)); 
var lon2 = lon1 + Math.atan2(Math.sin(brng)*Math.sin(d/R)*Math.cos(lat1), 
          Math.cos(d/R)-Math.sin(lat1)*Math.sin(lat2)); 

備選:

我做在的OpenLayers的方式重新投影我協調EPSG:900913這是米,做我的計算,然後轉換回原始投影。這可以通過pro4.j庫實現:http://trac.osgeo.org/proj/

+0

謝謝,我想創建一個45分鐘的循環路徑(開始和結束位置相同),這樣當我點擊地圖上的一個點時創建從地圖上的這個點開始的三個隨機點以這樣的方式從A到A的距離是45分鐘,例如AbcdA。當b,c,d是地圖上的三個隨機點時。任何關於它的想法 – Sara

+0

好的,我確實接受了你的回答 – Sara

+0

如何計算軸承或它可能是任何東西像45或90或任何東西...... – Sara