Understanding Great Circle Arcs Intersection Algorithm
The following material is the result of my attempt to understand the nice example from Jason Davies. I was puzzled about the origin of the algorithm used to find the intersection of two great circle arcs. Google helped and I discovered Roger Stafford’s post in Matlab newsgroup and the relevant Python’s implementation in the Spherical Geometry Toolkit.
The algorithm
You have two great circle arcs on a sphere,
where
These Cartesian coordinates correspond to a hypothetical spherical “earth” of unit radius, but that does not interfere in the following computations.
Let
$ = $ is the vector normal to the plane going through the arc
(The normalization was not mentioned in Roger’s post but it is implemented in the Spherical Geometry Toolkit and by Jason’s example.)
Then, let’s define the following quantities:
(These quantities are crucial: they represent the projection of
The arcs
If they do intersect, you can transform the corresponding vector,
References
- Roger Stafford’s post on Matlab newsgroup (but it lacks the normalization step which is instead used in Jason Davies code, and in Spherical Geometry Toolkit)
- implementation in Python as part of the Spherical Geometry Toolkit
- Jason Davies implementation in D3.js
Originally written and published with StackEdit, later moved to Jekyll and GitHub Pages
Reuse
Citation
@online{spinielli2014,
author = {Spinielli, Enrico},
title = {Understanding {Great} {Circle} {Arcs} {Intersection}
{Algorithm}},
date = {2014-10-19},
url = {https://enrico.spinielli.net/posts/2014-10-19-understanding-great-circle-arcs},
langid = {en}
}