- Suppose that we want to smoothly move from point {$A$} (in 3D, or {$E^3$}) to point {$B$}.
- Our goal is to move along a great circle from {$A$} to {$B$} by varying {$\theta$}.
- That will be a 2D rotation in the plane {$\cal P$} determined by {$OAB$}.
- The normal to the plane {$\cal P$} is {$ N = A \times B $}.
- However {$|N|\neq 1 $} most of the time, so we'll have to normalize its length later.
- In {$\cal P$}, {$A$} serves as the X-axis.
- {$T=N \times A$} serves as the Y-axis.
- {$T= (A\times B) \times A = (A\cdot A)B - (A\cdot B) A = B - (A\cdot B) A $}
- If the angle between {$A$} and {$B$} is {$\alpha$}, then {$A\cdot B = \cos\alpha $}.
- We have to normalize {$T$} to {$\widehat{T} $}. To do that, divide by {$|T| = \sqrt{1-(A\cdot B)^2} $}.
- {$\widehat{T} = \frac{B}{\sqrt{1-(A\cdot B)^2} } - \frac{ (A\cdot B)} { \sqrt{1-(A\cdot B)^2}} A $}.
- Note that, if {$A\perp B$} then {$\widehat{T} = B $}.
- Now, to interpolate, {$ C = A \cos\theta + \widehat{T} \sin\theta $}
- {$ C = A\cos\theta + \left(\frac{B}{\sqrt{1-(A\cdot B)^2} } - \frac{ (A\cdot B)} { \sqrt{1-(A\cdot B)^2}} A \right) \sin\theta $}
- {$ C = A\left(\cos\theta - \frac{(A\cdot B)\sin\theta}{\sqrt{1-(A\cdot B)^2}}\right) + B\frac{\sin\theta}{\sqrt{1-(A\cdot B)^2}} $}
- We could rewrite it thus: {$$ C(\theta) = \frac{A\left(\sin\alpha\cos\theta - \cos\alpha\sin\theta\right) + B\sin\theta}{\sin\alpha} $$}
- ... and then thus: {$$ C(\theta) = A \cos\theta + \left(\frac{B-A\cos\alpha }{\sin\alpha}\right)\sin\theta $$}
- {$\theta=0$} gives {$A$} and {$\theta=\alpha$} gives {$B$}.
Summarizing:
To interpolate points {$C$} along a great circle from {$A$} to {$B$}, where {$|A|=|B|=1$}:
Let {$\alpha$} be the angle between {$A$} and {$B$}. Then
{$$ C(\theta) = A \cos\theta + \left(\frac{B-A\cos\alpha }{\sin\alpha}\right)\sin\theta $$}
for {$0\le\theta\le\alpha$}.
Example:
- Let {$A=(1,0,0), B = \left(\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}}, 0\right) $}
- Note that {$ |A| = |B| = 1 $}.
- Then {$A\cdot B=\frac{1}{\sqrt{2}} $}, {$C = (\cos\theta, \sin\theta, 0) $}.