Homogeneous transformation matrix (10)
From axis-angle form to quaternion.
We can express a rotation in terms of axis-angle form. One way to write it is a (rotation axis, rotation angle) pair, or
where is a 3D unit vector and . The other way is to write the product of the two:
If is not a zero vector, then the way to recover (1) is simply
Otherwise, if , then and we let by convention.
There is a third way: we write it as a unit vector of size 4:
To convert to (1) is also simple:
The vector here is a quaternion, a very powerful tool to study and analyze 3D rotation matrices. In this blog we do not give the complete mathematical definition of it nor enumerate all of its numerous useful properties. However, while we try to solve some interesting rotation problems, we will then mention some of those properties and give some derivations about them.
The first number in is its scalar part, or real part. The last three numbers are ’s imaginary parts—there are three imaginary units for a quaternion: , , and , such that
Hence we can also write in (2) as