在3d中的2个光盘之间的交叉点

时间:2014-09-16 13:34:41

标签: algorithm geometry computational-geometry

我正在尝试找到一种算法或一种方法来找到球体上两个圆之间的交点(在3d中)。例如,如果我有两个圆心位于两个点A(latitude1,longitude1) and B(latidude2,longitude2) ,假设它们相交,我怎样才能找到这两个圆之间的交点?有算法吗?

谢谢

1 个答案:

答案 0 :(得分:2)

  1. Convert from latitude/longitude to 3D Cartesian coordinates.

  2. 对于每个圆圈,找到方程nx x + ny y + nz z = d 与球体相交的平面是圆。假设 球体以原点为中心,即法线向量 (nx, ny, nz)是圆心(cx, cy, cz)(投影或 没有)正常化后。

                     (cx, cy, cz)
    (nx, ny, nz) = -----------------
                   ||(cx, cy, cz)||
                                   2
    

    使用毕达哥拉斯计算距离d。设r为半径 圆圈的R是球体的半径。

     2    2    2
    R  = d  + r
          _______     _______________
         | 2    2    |
    d = \|R  - r  = \|(R + r) (R - r)
    

    第二个表达式是数值稳定性的首选。

    如果我们只知道球体表面上的长度r' 将圆的投影中心放到圆上,然后计算

    d = R cos(r'/R)
    r = R sin(r'/R).
    

    在这种情况下,我们实际上不需要r

  3. Find the intersection of the two planes, a line.

  4. Find the intersection of the line and the sphere, between zero and two points.

  5. Convert the points to latitude/longitude.