2015-11-02 190 views

回答

1

良好的公式生成两个均匀随机值rFi在范围0..1
计算距离作为d = Radius * Sqrt(r)description here for plane circle
轴承计算作为Theta=2 * Pi * Fi
查找给定中心点的纬度/经度坐标和在单元计算出d和Theta作为described hereDestination point given distance and bearing from start point

JavaScript: 
(all angles 
in radians) 
var φ2 = Math.asin(Math.sin(φ1)*Math.cos(d/R) + 
        Math.cos(φ1)*Math.sin(d/R)*Math.cos(θ)); 
var λ2 = λ1 + Math.atan2(Math.sin(θ)*Math.sin(d/R)*Math.cos(φ1), 
         Math.cos(d/R)-Math.sin(φ1)*Math.sin(φ2)); 

where φ is latitude, λ is longitude, 
θ is the bearing (clockwise from north), d being the distance travelled, 
R the earth’s radius