A Mathematical Review

A.1 Rotation transforms

Rotation matrices are used to describe the orientation of 3D coordinate frames in space, and to transform vectors between these coordinate frames.

Figure A.1: Two coordinate frames A and B rotated with respect to each other.

Consider two 3D coordinate frames A and B that are rotated with respect to each other (Figure A.1). The orientation of B with respect to A can be described by a 3\times 3 rotation matrix {\bf R}_{BA}, whose columns are the unit vectors giving the directions of the rotated axes {\bf x}^{\prime}, {\bf y}^{\prime}, and {\bf z}^{\prime} of B with respect to A.

{\bf R}_{BA} is an orthogonal matrix, meaning that its columns are both perpendicular and mutually orthogonal, so that

{\bf R}_{BA}^{T}\,{\bf R}_{BA}={\bf I} (A.1)

where {\bf I} is the 3\times 3 identity matrix. The inverse of {\bf R}_{BA} is hence equal to its transpose:

{\bf R}_{BA}^{-1}={\bf R}_{BA}^{T}. (A.2)

Because {\bf R}_{BA} is orthogonal, |\det{\bf R}_{BA}|=1, and because it is a rotation, \det{\bf R}_{BA}=1 (the other case, where \det{\bf R}_{BA}=-1, is not a rotation but a reflection). The 6 orthogonality constraints associated with a rotation matrix mean that in spite of having 9 numbers, the matrix only has 3 degrees of freedom.

Now, assume we have a 3D vector {\bf v}, and consider its coordinates with respect to both frames A and B. Where necessary, we use a preceding superscript to indicate the coordinate frame with respect to which a quantity is described, so that {}^{A}{\bf v} and {}^{B}{\bf v} and denote {\bf v} with respect to frames A and B, respectively. Given the definition of {\bf R}_{AB} given above, it is fairly straightforward to show that

{}^{A}{\bf v}={\bf R}_{BA}\,{}^{B}{\bf v} (A.3)

and, given (A.2), that

{}^{B}{\bf v}={\bf R}_{BA}^{T}\,{}^{A}{\bf v}. (A.4)

Hence in addition to describing the orientation of B with respect to A, {\bf R}_{BA} is also a transformation matrix that maps vectors in B to vectors in A.

It is straightforward to show that

{\bf R}_{BA}^{-1}={\bf R}_{BA}^{T}={\bf R}_{AB}. (A.5)
Figure A.2: Schematic illustration of three coordinate frames A, B, and C and the rotational transforms relating them.

A simple rotation by an angle \theta about one of the basic coordinate axes is known as a basic rotation. The three basic rotations about x, y, and z are:

{\bf R}_{x}(\theta)=\left(\begin{matrix}1&0&0\\
0&\cos(\theta)&-\sin(\theta)\\
0&\sin(\theta)&\cos(\theta)\end{matrix}\right),
{\bf R}_{y}(\theta)=\left(\begin{matrix}\cos(\theta)&0&\sin(\theta)\\
0&1&0\\
-\sin(\theta)&0&\cos(\theta)\end{matrix}\right),
{\bf R}_{z}(\theta)=\left(\begin{matrix}\cos(\theta)&-\sin(\theta)&0\\
\sin(\theta)&\cos(\theta)&0\\
0&0&1\end{matrix}\right).

Next, we consider transform composition. Suppose we have three coordinate frames, A, B, and C, whose orientation are related to each other by {\bf R}_{BA}, {\bf R}_{CB}, and {\bf R}_{CA} (Figure A.6). If we know {\bf R}_{BA} and {\bf R}_{CA}, then we can determine {\bf R}_{CB} from

{\bf R}_{CB}={\bf R}_{BA}^{-1}\,{\bf R}_{CA}. (A.6)

This can be understood in terms of vector transforms. {\bf R}_{CB} transforms a vector from C to B, which is equivalent to first transforming from C to A,

{}^{A}{\bf v}={\bf R}_{CA}\,{}^{C}{\bf v}, (A.7)

and then transforming from A to B:

{}^{B}{\bf v}={\bf R}_{BA}^{-1}\,{}^{A}{\bf v}={\bf R}_{BA}^{-1}\;{\bf R}_{CA}%
{}^{C}{\bf v}={\bf R}_{CB}\,{}^{C}{\bf v}. (A.8)

Note also from (A.5) that {\bf R}_{CB} can be expressed as

{\bf R}_{CB}={\bf R}_{AB}\,{\bf R}_{CA}. (A.9)

In addition to specifying rotation matrix components explicitly, there are numerous other ways to describe a rotation. Three of the most common are:

Roll-pitch-yaw angles

There are 6 variations of roll-pitch-yaw angles. The one used in ArtiSynth corresponds to older robotics texts (e.g., Paul, Spong) and consists of a roll rotation r about the z axis, followed by a pitch rotation p about the new y axis, followed by a yaw rotation y about the new x axis. The net rotation can be expressed by the following product of basic rotations: {\bf R}_{z}(r)\,{\bf R}_{y}(p)\,{\bf R}_{x}(y).

Axis-angle

An axis angle rotation parameterizes a rotation as a rotation by an angle \theta about a specific axis {\bf u}. Any rotation can be represented in such a way as a consequence of Euler’s rotation theorem.

Euler angles

There are 6 variations of Euler angles. The one used in ArtiSynth consists of a rotation \phi about the z axis, followed by a rotation \theta about the new y axis, followed by a rotation \psi about the new z axis. The net rotation can be expressed by the following product of basic rotations: {\bf R}_{z}(\phi)\,{\bf R}_{y}(\theta)\,{\bf R}_{z}(\psi).