Intersection of two arcs on sphere

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!


Solution 1:

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

Solution 2:

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.