Great circle through two points on a sphere
Given two points on a unit sphere, there is a unique great circle passing through the two points. This post will show two ways to find a parameterization for this circle.
Both approaches have their advantages. The first derivation is shorter and in some sense simpler. The second derivation is a little more transparent and generalizes to higher dimensions.
Let the two points on our sphere be v and w. If these two vectors are orthogonal, then the great circle connecting them is given by
cos(t) v + sin(t) w.
The problem is that w might not be orthogonal to v. So the task is to find a new vector u in the plane spanned by v and w that is perpendicular to v.
Cross productThe cross product of two vectors in three dimensions is perpendicular to both. So
z = v * w
is orthogonal to v and w. So
y = z * v
is perpendicular to v and lives in the same plane as w. So y is the vector we're looking for, except that it might not have unit length. (In fact, it's probably too short. It will have length equal to sin where is the angle between v and w. If sin were 1, then v and w were orthogonal and we wouldn't need to go through this exercise.)
So we need to normalize y, setting
u = y / || y ||.
This solution is quick and simple, but it obscures the dependence on w. It also only works in 3 dimensions because cross product is only defined in 3 dimensions.
If you look back, we used the fact that we're working in ^3 when we argued that y was in the plane spanned by v and w. In more dimensions, we could find a vector z perpendicular to v and w, and a vector y perpendicular to z but not in the plane of v and w.
More general solutionWe need to find a unit vector u in the space spanned by v and w that is orthogonal to v. Since u is in the space spanned by v and w,
u = a v + b w,
for some a and b, and so a parameterization for our circle is
cos(t) v + sin(t) (a v + b w).
We just need to find a and b. An advantage of this approach over the approach above is that the vector w is explicit in the parameterization.
Also, v and w could be vectors on some high-dimensional unit sphere. Even if v and w live in 100 dimensions, the subspace they span is two-dimensional and everything here works.
Since u is orthogonal to v, we have
u v = (a v + b w) v = a + b cos = 0
where the angle between v and w is given by
cos = v w.
We can obtain another equation for a and b from the fact that u is a unit vector:
a^2 + b^2 + 2 ab cos = 1.
The solution to our system of equations for a and b is
a = cot
b = csc
and so an equation for our circle is
cos(t) v + sin(t) (cot v - csc w).
The post Great circle through two points on a sphere first appeared on John D. Cook.