
i
i
i
i
i
i
i
i
542 A. Rotation with Quaternions
For a normalized quaternion [w, x, y, z], the corresponding 4 × 4matrix
is
⎡
⎢
⎢
⎣
1 − 2y
2
− 2z
2
2xy + 2wz 2xz −2wy 0
2xy − 2wz 1 − 2x
2
− 2z
2
2yz + 2wx 0
2xz + 2wy 2yz − 2wx 1 − 2x
2
− 2y
2
0
0001
⎤
⎥
⎥
⎦
.
It is important to note that a 4 × 4 matrix can encapsulate positional
transformations as well as rotational ones. A unit quaternion only describes
pure rotations. So, when quaternions are combined, the complex rotation
they represent is with respect to axes passing through the coordinate origin
(0, 0, 0).
A.3 Converting a Matrix to a Quaternion
If the rotational matrix is given by
M =
⎡
⎢
⎢
⎣
a
00
a
01
a
02
0
a
10
a
11
a
12
0
a
20
a
21
a
22
0
0001
⎤
⎥
⎥
⎦