Problem 6
Quaternion package
Definition of distance metric
Part (a)
See solutions text.
Part (b)
See solutions text.
Part (c)
Here are the quaternions:
Let's just verify that they are unit quaternions:
Now let's compute the distances:
Now, let's verify that these numbers obey the triangle inequality:
Part (d)
Note that the distance measure seems to be correlated to the angle of rotation between two quaternions. From q to qp, and qp to qpp, the rotation angle between them is the same (π/3), as is the distance measure. The rotation angle between q and qpp is almost twice as large as between q and qp, as is the distance measure. Therefore, the distance measure appears to be strongly related to the angle of rotation between two quaternions.
Part (e)
Let us assign the following three quaternions q, p and u. We will proceed by first showing that the distance measure between u (the zero-rotation unit quaternion) and an arbitrary quaternion p depends only on the rotation angle θ. We will then generalize this result by rotating both p and u by an arbitrary quaternion q, and showing that the distance measure remains the same.
The two results (res1a and res1b) above give two equivalent expressions for d(u, p). The graph above plots this for θ ranging from 0 to 2π. Note that the distance measure reaches a peak at θ=π. What remains is to show that this result does not change if we multiply both u and p by an arbitrary unit quaternion q.
Note that this result is, as expected identical, to the previous result and shows that the distance measure is dependent only on the angle of rotation θ between two unit quaternions.
Part (f)
We will use the result from part (e) to illustrate the triangle inequality. Consider three unit quaternions q, q' and q''. Let q and q' be separated by an angle of rotation θ1, and let q' and q'' be separated by an angle of rotation θ2. Also define d(θ) = distance measure for two unit quaternions separated by an angle of rotation θ. Then, all that needs to be shown is that d(θ1) + d(θ2) >= d(θ1 + θ2) for all θ1, θ2, or alternatively that f(θ1, θ2) = d(θ1) + d(θ2) - d(θ1 + θ2) >= 0. This is most easily shown graphically.
Note from the two plots, that f(θ1, θ2) is always greater than zero.
Created by Mathematica (September 29, 2003)