Intersection of two arcs on sphere

9.5k Views Asked by At

I have two arcs on a sphere that are defined as pair of points: $(\theta_0, \varphi_0)$, $(\theta_1, \varphi_1)$. I need to find a point where they intersect, or some indication if they don't. What is important is that they are arcs, not circles, so it is important to find intersection that is on the arcs specifically (not on projected circles). Arcs are meant to be shortest possible arcs. I am failing to find any specific equations on the internet. Thanks!

3

There are 3 best solutions below

0
On BEST ANSWER

You can find a javascript implementation here:

http://www.movable-type.co.uk/scripts/latlong.html

and a good explanation here:

http://www.boeing-727.com/Data/fly%20odds/distance.html

9
On

As far as I can tell to verify that two arcs intersect on the same sphere they must have an angular range that has at least shares one particular value of phi and theta, for instance if one arc covers (30,30 ) to (60, 60) and the other covers (0, 0) to (0, 60) they wouldn't intersect even if theta agrees. Basically the condition is that the intervals for both sets of phi and theta have nonzero set theoretic intersection at the same time, that is the ranges for phi must have at least one value in common at the same time as both ranges for theta have at least one value in common.

0
On

Here's an outline of how you could do it (though I suspect there are more efficient methods).

  • For each arc, obtain the great circle it is on. If you don't already have this, you can define it with its (Cartesian) normal vector, i.e. cross product of the two points on the arc you have.
  • With these two great circles, find the point of intersection. One fairly inelegant way of doing this is:
    • take the cross product (again) of the two great circle normals $\mathbf{n_3}=\mathbf{n_1}\times \mathbf{n_2}$ - and use these 3 vectors to define 3 planes (all through the origin).
      • Some caution is needed here in case the two arcs you were provided with originally were on the same great circle.
    • Define $\mathbf{p_0}$ as the intersection of these three planes (calculate e.g. with matrix inversion or LU factorisation), now define $\mathbf{p_x}$ as this intersection of the line $\mathbf{p_0} + \lambda \mathbf{n}_3$ with the unit sphere (this involves solving a quadratic)
  • Finally, you need to check whether this point $\mathbf{p_x}$ (which lies on both great circles) is inside the arcs you specify. A way (again there may be better ways) to do this is:
    • (For each arc) parameterize the great circle in terms of a single parameter $\alpha$, defined as the angle from the $\mathbf{u_0}= (\theta_0,\phi_0)$ end.
    • $\alpha_0 = 0$,
    • $\alpha_1=acos(\mathbf{v_1}.\mathbf{u_0})$
    • $\alpha_{p_x}=acos(\mathbf{p_x}.\mathbf{u_0})$
    • Check if $\alpha_{p_x} < \alpha_{1}$, if so, repeat for other arc

You've probably lost interest by now, but I'm posting this as a placeholder so someone can point out a better way.