【问题标题】:Create coordinate based on distance and direction根据距离和方向创建坐标
【发布时间】:2017-12-22 20:23:01
【问题描述】:

所以我有 x 经度和 y 纬度的坐标 (A)。我想要的是根据用户输入创建新坐标(B),其中坐标和方向(0-360)之间的距离(米)。用什么公式来实现?

到目前为止,我所做的是使用 answer1answer2 中的这个公式

new_latitude  = latitude  + (dy / r_earth) * (180 / pi);
new_longitude = longitude + (dx / r_earth) * (180 / pi) / cos(latitude * pi/180);

但它只是创建一个方向的新坐标,我想要的是方向可以改变。

【问题讨论】:

    标签: algorithm gps coordinates distance latitude-longitude


    【解决方案1】:

    您可以使用this excellent site 中的公式(部分目标点给定距离起点和方位角)

    var φ2 = Math.asin( Math.sin(φ1)*Math.cos(d/R) +
                        Math.cos(φ1)*Math.sin(d/R)*Math.cos(brng) );
    var λ2 = λ1 + Math.atan2(Math.sin(brng)*Math.sin(d/R)*Math.cos(φ1),
                             Math.cos(d/R)-Math.sin(φ1)*Math.sin(φ2));
    

    其中φ是纬度,λ是经度,θ是方位角(从北顺时针方向),δ是角距离d/R; d是经过的距离,R是地球的半径

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-11-25
      • 1970-01-01
      • 2017-06-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多