2017-08-09 48 views
0

我想计算从经纬度给定的点到由两点(大圆圈的一部分)给出的线段的距离。所有的坐标都在WGS84中给出。指向大圆段距离

enter image description here

我知道如何在笛卡尔坐标而不是球体上的计算此。有人可以提供这个公式吗?

+1

我想你可能有更多的运气与此有关mathematics.stackexchange –

+0

我投票关闭这一问题作为题外话,因为它是关于[math.se]而不是编程或软件开发。 – Pang

回答

3

这是交叉轨道距离described here

dxt = asin(sin(δ13) ⋅ sin(θ13−θ12)) ⋅ R 
    where 
δ13 is (angular) distance from start point to third point 
    θ13 is (initial) bearing from start point to third point 
    θ12 is (initial) bearing from start point to end point 
    R is the earth’s radius 

可以计算出所需的距离,并使用公式从给定的页面轴承

distance 
a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2) 
c = 2 ⋅ atan2(√a, √(1−a)) 
d = R ⋅ c 
where 
φ is latitude, λ is longitude, R is earth’s radius (mean radius = 6,371km); 

bearing 
θ = atan2(sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ) 
    where 
φ1,λ1 is the start point, φ2,λ2 the end point (Δλ is the difference in longitude) 

注意,角度需要采用弧度传递到三角函数

+0

因此对不起,我将删除我的评论。 – Blindman67

2
  1. 球形至2D笛卡尔

    如果距离不是太远,周围没有极奇点你既可以线段和线路从你的观点,并垂直于你的段球面坐标的发光转换(如果它们还没有)并且使用2个角度作为笛卡尔空间(忽略半径)。

    1. 计算交点
    2. 转换回点和交叉点之间的球面
    3. 计算弧长

      很难说,如果你使用的球或WGS84还是什么....

  2. 笛卡尔3D

    您可以将圆弧段作为3D线处理,并在发现相交时将其投影到曲面上。事情是这样的:在3D笛卡尔

  3. 项目回地表

    对于球面

    3D cartesian + projection

    1. 行查找与正常的交点就是这个简单的投影意味着将矢量长度更改为R(如果球体以(0,0,0)为中心)。 2分

      为球形表面也是简单之间

    2. 计算弧长只是计算相交点和之间的角度...

      ang = acos(dot(intersection,point)); // [radians] 
      

      ,并转换为弧长

      d = ang*R; // [same Units as R] 
      
+0

我正在使用WGS84。 – user2033412

+0

@ user2033412更复杂一点......投影迭代完成以提高精度...您只需搜索'lat'直到它适合'x,y,z'开始球面投影,然后更改'lat '以最小化距离... – Spektre

+0

@ user2033412请参阅[如何将球面速度坐标转换为笛卡尔](https://stackoverflow.com/a/41161714/2521214)以及链接的答案,以获得一些其他想法... – Spektre