Distance from point to line on Earth

后端 未结 6 1110
傲寒
傲寒 2020-12-09 14:21

I need something as simple as

\"Subject 1.02: How do I find the distance from a point to a line?\"

But that works with Lon/Lat.

6条回答
  •  孤街浪徒
    2020-12-09 14:41

    I'll elaborate on Lior Kogan's excellent answer by using a geometrical (instead of analytical) approach.

    The great circle that contains the "line" lies on a plane passing through the centre of the spheroid. This plane is orthogonal to the vector obtained as cross-product of the vectors that pass through the origin and, respectively, p1 and p2.

    Now, we are looking for the plane orthogonal to the one we have, passing for p0. This can be easily calculated, and the intersection of this plane with the spheroid should (WARNING: I'm in kinda of a hurry, and am not sure this step is mathematically sound) be the great circle orthogonal to the "line". The intersection of the arcs should be the point you are looking for, and is can be calculated as the interception of the line common to the two planes (cross product of the vectors orthogonal to each plane) and the spheroid.

提交回复
热议问题