# Introduction¶

In measuring 3-dimensional orientation, the current orientation is defined by characterizing the 3-dimensional rotation from a somewhat arbitrarily chosen reference orientation to the current orientation. For example, for the description of eye movements, the reference orientation is usually defined as the position the eye assumes when the subject is looking straight ahead, while the head is kept upright. Straight ahead can be defined either as the center of the oculomotor range, or as looking at a target which is exactly horizontally in front of the eye. In the latter case, eye position in the head is a function of head position in space, when the eye is in the reference position. In the following we will use the latter definition of straight ahead.

To describe the 3-dimensional orientation, Euler’s Theorem can be applied: it states that for every two orientations of an object, the object can always move from one to the other by a single rotation about a fixed axis (Euler, 1775) . Often the rotation from the reference orientation to the current orientation is not described through this single rotation, but is decomposed into three consecutive rotations about well defined, hierarchically nested axes (e.g. Goldstein, 1980). The following section will deal with this three-rotation description of 3-dimensional angular orientation, while quaternions and rotation vectors, which characterize the 3-dimensional orientation by a single rotation, will be covered in later sections.

# Rotations about a Single Axis¶

Let us start with something rather simple, the rotation in a plane. Rotations in a plane can be uniquely described in two ways:

• In Cartesian coordinates, through a Rotation Matrix: the rotation matrix is given by the coordinates of a normalized Cartesian coordinate system, rotated by the desired amount.
• In polar coordinates: through the angle $$\theta$$, characterizing the rotation about an axis perpendicular to the plane.

If a point $$\vec P = \left( {\begin{array}{*{20}{c}} x\\ y \end{array}} \right)$$ is rotated by an angle $$\theta$$ into a point $$\vec{P'} = \left( {\begin{array}{*{20}{c}} {x'}\\ {y'} \end{array}} \right)$$, the new coordinates are given by

(1)$\begin{split}\left( {\begin{array}{{20}{c}} {x'}\\ {y'} \end{array}} \right) = \left[ {\begin{array}{{20}{c}} {\cos (\theta )}&{ - \sin (\theta )}\\ {\sin (\theta )}&{\cos (\theta )} \end{array}} \right] \cdot \left( {\begin{array}{{20}{c}} x\\ y \end{array}} \right)\end{split}$

Defining the Rotation Matrix

$\begin{split}{\bf{R}} = \left[ {\begin{array}{{20}{c}} {\cos \theta }&{ - \sin \theta }\\ {\sin \theta }&{\cos \theta } \end{array}} \right] \, ,\end{split}$

Eqn. (1) can be rewritten as

$\vec{P'} = {\bf{R}} \cdot \vec P$

Note that the columns of the rotation matrix are equivalent to the unit vectors $${\vec e_1},{\vec e_2}$$ rotated by the angle $$\theta$$! Or in other words, the rotation matrix is the projection of the rotated unit vectors onto the coordinate axes.

$\left[ \vec{e'_1}\,\vec{e'_2} \right] = {\bf{R}} \cdot \left[ \vec{e_1}\,\vec{e_2} \right] = \bf{R}$

# Rotation about Coordinate Axes in 3D¶

The same ideas can be applied to three dimensions, by extending the number of unit vectors to three

$\bf{R} = \left[ \vec{e'_1}\,\vec{e'_2}\,\vec{e'_3}\ \right]$

In the following we will often use eye movements as an example, as they can be easily visualized. In that case, the reference coordinate system or space fixed coordinate system will be the coordinate system provided by the head, and the object fixed coordinate system will be a coordinate system fixed with the eyeball, and with the 1-axis aligned with the line of sight (often referred to as gaze).

In order to define single axis rotations in three dimensions, we first have to establish an external, space-fixed coordinate system, and an object-fixed coordinate system to describe the 3-dimensional orientation of the object with respect to space. Let $$\left[ {{{\vec h}_1}\,{{\vec h}_2}\,{{\vec h}_3}} \right]$$ be a right-handed, space-fixed coordinate system such that $${\vec h_1}$$ coincides with the line of sight when the eye is in the reference position, $${\vec h_2}$$ with the interaural axis, and $${\vec h_3}$$ with the earth vertical (Fig. 46 A). As a reminder, right-handed means

${\vec h_1} \times {\vec h_2} = {\vec h_3}$

Let $$\left[ {{{\vec e}_1}\,{{\vec e}_2}\,{{\vec e}_3}} \right]$$ denote a right-handed object-fixed coordinate system (i.e. it moves with the object, e.g. the eye) such that $$\left[ {{{\vec e}_1}\,{{\vec e}_2}\,{{\vec e}_3}} \right]$$ coincides with the space-fixed coordinate system $$\left[ {{{\vec h}_1}\,{{\vec h}_2}\,{{\vec h}_3}} \right]$$ when the object is in the reference position.

Any horizontal rotation of the object-fixed coordinate system (and thus of the object) from the reference position to a new position, as indicated in Fig. 46 B, can be described by

(2)${\vec e_i} = {\bf{R}} \cdot {\vec h_i}, \quad i=1,2,3$

The components of the vectors $$\vec{e_i}$$ are expressed relative to the space-fixed coordinate system $$\left[ {{{\vec h}_1}\,{{\vec h}_2}\,{{\vec h}_3}} \right]$$, and the rotation matrix R describes a rotation about a space-fixed axis, independent of the orientation of the object. Since for a purely horizontal movement the rotation matrix R describes a rotation about $${\vec h_3}$$ by an angle of $$\theta$$, let us call it $$\bf{R}_3(\theta)$$. It is given by

(3)$\begin{split}{{\bf{R}}_3}(\theta ) = \left[ {\begin{array}{{20}{c}} {\cos \theta }&{ - \sin \theta }&0\\ {\sin \theta }&{\cos \theta }&0\\ 0&0&1 \end{array}} \right]\end{split}$

In the same way, purely vertical movements - i.e. rotations about $${\vec h_2}$$ - by an angle of $$\phi$$ can be described by

(4)$\begin{split}{{\bf{R}}_2}(\phi ) = \left[ {\begin{array}{{20}{c}} {\cos \phi }&0&{\sin \phi }\\ 0&1&0\\ { - \sin \phi }&0&{\cos \phi } \end{array}} \right]\end{split}$

and purely torsional movements - i.e. rotations about $${\vec h_1}$$ - by an angle of $$\psi$$ by

(5)$\begin{split}{{\bf{R}}_1}(\psi ) = \left[ {\begin{array}{{20}{c}} 1&0&0\\ 0&{\cos \psi }&{ - \sin \psi }\\ 0&{\sin \psi }&{\cos \psi } \end{array}} \right]\end{split}$

With these definitions, positive $$\theta$$, $$\phi$$, and $$\psi$$ values correspond to leftward, downward, and clockwise movements (as seen from the subject when regarding eye movements).

For one-dimensional movements no distinction has to be made between rotations about object-fixed or space-fixed axes. Since the object-fixed and space-fixed coordinate systems coincide when the object is in the reference position, the axis about which the object rotates is the same in the object-fixed and space-fixed system.

## Exercise: Projection into Plane¶

This example will provide a first step into the measurement of movements with video-based systems. You observe the movement of an object in space with a camera, and obtain the data in the image plane of the camera, as shown in the Figure below. The data units are cm:

• Read in the data from the file particle_trajectory.txt , and write a program to calculate the velocity in the x- and y-direction.
• Someone told you that the data center is 200 cm in front of the camera, and the trajectory lies in a plane that is tiled by 30$$^\circ$$about the x-axis. Calculate the 3D position of the trajectory of the particle (see Fig. 47).
• Calculate the 3D position $$p_{shifted}$$ of the particle in camera coordinates if you position the camera 50 cm forward, and 100 cm up.
• Calculate the position $$p_{shiftRot}$$ (with respect to the camera), if you now rotate the camera 34$$^\circ$$downward.

## Active and Passive Rotations¶

To describe the rotation of the object-fixed coordinate system from the reference position to any new position, equation [eq:eyehead] still holds. In other words, the rotation matrix R still completely describes the current orientation. However, its elements are no longer determined by the relatively simple formulas in Eqns. (3) - (5).

To understand the situation better, let us look at a simple downward rotation from the position in the Fig. 49: how should we distinguish between a downward movement of the object by a rotation about the space-fixed axis $${\vec h_2}$$ (as shown in Fig. 49 A), and a downward movement by a rotation about the rotated, object-fixed axis $${\vec e_2}$$ ( Fig. 49 B)? Mathematically, the difference between rotations in space-fixed coordinates and object-fixed coordinates lies in the sequence in which the rotations are executed. This is illustrated in the Fig. 50. The upper column (Fig. 49 A) shows a rotation of an object about $${\vec h_3}$$ by $$\theta$$, followed by a rotation about the space-fixed axis $${\vec h_2}$$ by $$\phi$$. Mathematically this is described by

(6)$\vec{e_i} = \mathbf{R_2}(\phi) \cdot \mathbf{R_3}(\theta) \cdot \vec{h_i}$

with $$\theta = \phi = 90^\circ$$.

Inverting the sequence of two rotations about space-fixed axes changes the final orientation of the object. This can be seen in Fig. 50 B, where a rotation is first performed about $${\vec h_2}$$ , and then about the space-fixed $${\vec h_3}$$ . This sequence is mathematically described by

(7)$\vec{e_i} = \mathbf{R_3}(\theta) \cdot \mathbf{R_2}(\phi) \cdot \vec{h_i}$

Equations (6) and (7) both describe rotations about space-fixed axes. However, they can also be re-interpreted as rotations about eye-fixed axes in the reverse sequence: Eqn. (6) can be re-interpreted as a rotation about the axis $${\vec e_2}$$ by $$\phi$$, followed by a rotation about the eye-fixed axis $${\vec e_3}$$ by $$\theta$$; and Eqn. (7) is equivalent to a rotation about $${\vec e_3}$$ by $$\theta$$, followed by a rotation about the object-fixed axis $${\vec e_2}$$ by $$\phi$$. Fig. 50 A and C demonstrate that rotations about space-fixed axes and rotations about object-fixed axes in the reverse sequence lead to the same final orientation. A mathematical analysis of this problem can be found in . This also gives the answer to the problem raised by Fig. 50, the combination of two rotations about the head fixed axes $${\vec h_3}$$ and $${\vec h_2}$$, as shown in Fig. 50 A, is mathematically described by Eqn. (6), while the combination of two rotations about the object-fixed axes $${\vec e_3}$$ and $${\vec e_2}$$, as shown in Fig. 50. Fig. 50 B, is described by Eqn. (7) . Rotations about space-fixed axes are often called active rotations or rotations of the object, since in successive rotations the axes of the successive rotations are unaffected by the preceding rotations of the object. Rotations about object-fixed axes are often referred to as passive rotations or rotations of the coordinate system, since each rotation changes the coordinate axes about which the next rotations will be performed. A combination of a horizontal and a vertical rotation of the object in a well defined sequence uniquely characterizes the direction of the forward direction. With eye movements this is the line of sight, or gaze direction; with a gun-turret on a ship this is the direction of the gun barrel. However, this does not completely determine the 3-dimensional orientation of the object, since the rotation about the forward direction, is still unspecified. A third rotation is needed to completely determine the orientation of the object.

## Fick-, Helmholtz-, and Euler-Angles¶

Systems that use such a combination of three rotations for the description of the orientation generally use passive rotations, or rotations of the coordinate system. Such rotations of the coordinate system can easily be demonstrated by considering gimbal systems. A gimbal is a ring that is suspended so it can rotate about an axis. Gimbals are typically nested one within another to accommodate rotation about multiple axes, and the hierarchy of passive rotations is automatically implemented.

### Fick Angles¶

Fig. 51 B shows a gimbal which corresponds to the Fick-sequence of rotations. This sequence of rotations - first a horizontal, then a vertical, and then a torsional rotation, has first been used by , and the angles $$\theta$$, $$\phi$$, and $$\psi$$ for this sequence are often referred to as Fick-angles. In the following we will denote Fick-angles by the subscript “F” ($$\theta_F, \phi_F, \psi_F$$). The rotation matrix corresponding to the Fick-sequence of rotations is

$\vec{e_i} = \mathbf{R_3}(\theta_F) \cdot \mathbf{R_2}(\phi_F) \cdot \mathbf{R_1}(\psi_F) :label: Fick$

Inserting equations [eq:R3] - [eq:R1] into equation [eq:Fick], $$\mathbf{R}_{Fick}$$ can be obtained as

(8)$\begin{split}\mathbf{R}_{Fick} = \left[ {\begin{array}{{20}{c }} {\cos {\theta _F}\cos {\phi _F}}&{\cos {\theta _F}\sin {\phi _F}\sin {\psi _F} - \sin {\theta _F}\cos {\psi _F}}&{\cos {\theta _F}\sin {\phi _F}\cos {\psi _F} + \sin {\theta _F}\sin {\psi _F}}\\ {\sin {\theta _F}\cos {\phi _F}}&{\sin {\theta _F}\sin {\phi _F}\sin {\psi _F} + \cos {\theta _F}\cos {\psi _F}}&{\sin {\theta _F}\sin {\phi _F}\cos {\psi _F} - \cos {\theta _F}\sin {\psi _F}}\\ { - \sin {\phi _F}}&{\cos {\phi _F}\sin {\psi _F}}&{\cos {\phi _F}\cos {\psi _F}} \end{array}} \right]\end{split}$

This provides a convenient way to find ($$\theta_F, \phi_F, \psi_F$$) when the rotation matrix R is given:

$\begin{split}\begin{array}{l} {\phi _F} = -\arcsin ({R_{31}})\\ {\theta _F} = \arcsin (\frac{{{R_{21}}}}{{\cos {\phi _F}}})\\ {\psi _F} = \arcsin (\frac{{{R_{32}}}}{{\cos {\phi _F}}}) \end{array}\end{split}$

Note: With the Python module sympy, the Fick matrix in Eqn. (8) can be found with

import sympy

# Symbolic version of rotation matrices
def R1_s():
''' Symbolic rotation matrix about the 1-axis, by an angle psi '''
psi = sympy.Symbol('psi')
return sympy.Matrix([[1,0,0],
[0, sympy.cos(psi), -sympy.sin(psi)],
[0, sympy.sin(psi), sympy.cos(psi)]])

def R2_s():
''' Symbolic rotation matrix about the 2-axis, by an angle phi '''
phi = sympy.Symbol('phi')
return sympy.Matrix([[sympy.cos(phi),0, sympy.sin(phi)],
[0,1,0],
[-sympy.sin(phi), 0, sympy.cos(phi)]])

def R3_s():
''' Symbolic rotation matrix about the 3-axis, by an angle theta '''
theta = sympy.Symbol('theta')
return sympy.Matrix([[sympy.cos(theta), -sympy.sin(theta), 0],
[sympy.sin(theta), sympy.cos(theta), 0],
[0, 0, 1]])

R_Fick = R3_s()*R2_s()*R1_s()


Terminology The names for different gimbal systems may differ significantly, depending on the area of application.

For example, in aeronautic engineering, the Fick angles are called Euler angles and the rotations about the z-, y-, and x-axes are called heading angle, elevation angle, and banking angle, respectively ([Kuipers, Quaternions and Rotation Sequences, 1999]).

In other contexts, angles of any type of gimbal system are referred to as Euler angles, and angles from rotation sequences that involve all three axes are called Tait-Bryan angles.

### Helmholtz Angles¶

The sequence of rotations is arbitrary, and can be replaced by a different sequence. thought it would be better to start with a rotation about a horizontal axis, and characterized eye positions by a vertical rotation, followed by a horizontal and then by a torsional rotation as shown in the Fig. 51:

(9)$\vec{e_i} = \mathbf{R_2}(\phi_H) \cdot \mathbf{R_3}(\theta_H) \cdot \mathbf{R_1}(\psi_H)$

The subscript “H” indicates that the angles refer to the Helmholtz-sequence of rotations. One should keep in mind that the orientation of the object is characterized by the values of the rotation matrix $$\mathbf{R}$$, and $$\mathbf{R}_{Fick}$$ and $$\mathbf{R}_{Helmholtz}$$ only give different parameterizations for the same rotation matrix. Using Eqns. (3) - (5) and matrix multiplication we get

(10)$\begin{split}\mathbf{R}_{Helm} = \left[ {\begin{array}{{20}{c}} {\cos {\theta _H}\cos {\phi _H}}&{ - \sin {\theta _H}\cos {\phi _H}\cos {\psi _H} + \sin {\phi _H}\sin {\psi _H}}&{\sin {\theta _H}\cos {\phi _H}\sin {\psi _H} + \sin {\phi _H}\cos {\psi _H}}\\ {\sin {\theta _H}}&{\cos {\theta _H}\cos {\psi _H}}&{ - \cos {\theta _H}\sin {\psi _H}}\\ { - \cos {\theta _H}\sin {\phi _H}}&{\sin {\theta _H}\sin {\phi _H}\cos {\psi _H} + \cos {\phi _H}\sin {\psi _H}}&{ - \sin {\theta _H}\sin {\phi _H}\sin {\psi _H} + \cos {\phi _H}\cos {\psi _H}} \end{array}} \right]\end{split}$

When $$\mathbf{R}$$ is given, the Helmholtz angles ($$\theta_H, \phi_H, \psi_H$$) can be obtained through

$\begin{split}\begin{array}{l} {\theta _H} = \arcsin ({R_{21}})\\ {\phi _H} = -\arcsin (\frac{{{R_{31}}}}{{\cos {\theta _H}}})\\ {\psi _H} = -\arcsin (\frac{{{R_{23}}}}{{\cos {\theta _H}}}) \end{array}\end{split}$

### Euler Angles¶

Another way to describe the 3d-orientation of an object is the use of Euler Angles. This convention is often found in technical literature. Thereby the orientation is described by (see Fig. below)

• a rotation about the z-axis
• followed by a rotation about the rotated x-axis
• followed by a rotation about the twice rotated z-axis
${{\bf{R}}_{Euler}} = {{\bf{R}}_3}(\gamma ) \cdot {{\bf{R}}_1}(\beta ) \cdot {{\bf{R}}_3}(\alpha )$

### Important Note¶

Care has to be taken, because the exact form of the rotation matrices depends on the definition of $$\mathbf{R}$$. Technical applications often use passive rotations for the definition of the rotation matrix, and the signs of the angles are switched compared to our definitions in Eqns. (3) - (5) . In those applications, the rotation about the z-axis is for described by

$\begin{split}{R_z}(\theta ) = \left[ {\begin{array}{{20}{c}} {\cos \theta }&{\sin \theta }&0\\ { - \sin \theta }&{\cos \theta }&0\\ 0&0&1 \end{array}} \right]\end{split}$

This notation is NOT used here!

## Combined Rotations¶

We often know the orientation of an object in space (e.g. a camera, or an eye), and the orientation of a reference frame (e.g. a tripod, for the camera; or the head, for the eye). How can the formulas given above be used to derive from these data the orientation of the object relative to our given reference frame (e.g. the orientation of the eye in the head)?

Let $$\mathbf{R_{head}}$$ be the rotation matrix describing the rotation of the reference frame with respect to a space-fixed coordinate system, and $$\mathbf{R_{eye}}$$ describe the rotation of the object in the reference frame (e.g. eye in head). From a geometric point of view, we first rotate the head, and then the eye in the (now rotated) head. In other words, we use passive rotations or rotations of the coordinate system. This determines the sequence of the two rotations, and the rotation matrix describing the gaze rotation, $$\mathbf{R_{gaze}}$$ , is - according to the discussion following Eqns. (6) and - (7) given by

(11)$\mathbf{R_{gaze}} = \mathbf{R_{head}} \cdot \mathbf{R_{eye}}$

Similarly, to describe the orientation of a camera-in-space (described by $$\mathbf{R}_{camera}^{space}$$ ), as shown in the Figure above, we have to combine the orientation of the tilted base (described by $$\mathbf{R}_{base}$$ ) and the orientation of the camera with respect to this base ($$\mathbf{R}_{camera}^{base}$$ ) as follows:

$\mathbf{R}_{camera}^{space} = \mathbf{R}_{base} \cdot \mathbf{R}_{camera}^{base}$

The way I personally remember these sequences: Let us for example take the following equation, which determines the orientation of the line-of-sight (LOS) of the camera

$\vec{c'} = \mathbf{R}_{base} \cdot \left( \mathbf{R}_{camera}^{base} \cdot \vec c \right)$

With base and camera in the reference orientation, $$\vec c$$ indicates the LOS of the camera. To find the current LOS, I first rotate the LOS of the camera on the base $$\left( \mathbf{R}_{camera}^{base} \cdot \vec c \right)$$. Then, in a second step I rotate the base, with the rotated camera already on it, to obtain the current orientation of the LOS $$\mathbf{R}_{base} \cdot \left( \mathbf{R}_{camera}^{base} \cdot \vec c \right)$$. subsection{Gimbal Lock}

## Gimbal Lock¶

Consider tracking a helicopter flying towards the aerial gun, described in the aerialGun example below, from the horizon. The helicopter flies towards the gun-site and is tracked by the gun in elevation and azimuth. The helicopter flies immediately above the gun-site (i.e. it is at zenith), when it changes direction and flies at 90 deg to its previous course. The gun cannot track this maneuver without a discontinuous jump in one or both of the gimbal orientations. There is no continuous motion that allows it to follow the target. It is in gimbal lock. So there is an infinity of directions around zenith that the gun cannot continuously track all movements of a target. Note that even if the helicopter does not pass through zenith, but only near zenith, so that gimbal lock does not occur, the system must still move exceptionally rapidly to track it, as it rapidly passes from one bearing to the other. The closer to zenith the nearest point is, the faster this must be done, and if it actually goes through zenith, the limit of these “increasingly rapid” movements becomes infinitely fast, namely discontinuous.

# Applications¶

In the following we will describe applications with one, two, and three degrees of freedom.

## One Degree of Freedom (DOF)¶

Question: If a gun that originally points straight ahead is to shoot at a target at $$P = (x/y)$$ , by which amount do I have to rotate the gun to point at that target (Fig. above)?

• The gun originally points straight ahead, so the direction of the bullet aligns with $${\vec e_1}$$ .
• The rotation of the gun is described by the rotation matrix $$R = \left[ {\begin{array}{*{20}{c}} {\cos \theta }&{ - \sin \theta }\\ {\sin \theta }&{\cos \theta } \end{array}} \right] = \left[ {\begin{array}{*{20}{c}} {\vec{e'_1}}&{\vec{e'_2}} \end{array}} \right]$$
• The direction of the gun after the rotation is given by $$\vec{e'_1} = \frac{{\vec P}}{{\left| {\vec P} \right|}}$$
• Combining these two equations, and looking at the y-component, we get $$\sin \theta = \frac{y}{{\sqrt {{x^2} + {y^2}} }} \to \theta = \arcsin \frac{y}{{\sqrt {{x^2} + {y^2}} }}$$

## Two DOF: 1) Projection into a plane¶

Parallel Projection The simplest transformation from a 3D object into the image plane is the parallel projection. To investigate an application, let us look at the projection of a pupil-center of an eye with radius r into an image plane. The location of the pupil center in 3D is given by

$\begin{split}\vec{c_p} = r*\left( {\begin{array}{*{20}{c}} {{R_{11}}}\\ {{R_{21}}}\\ {{R_{31}}} \end{array}} \right)\end{split}$

The parallel projection of the center of the eye (i.e. a multiple of the rotated unit vector $$\vec{e_1}$$ ) into a coordinate plane is given simply by

$\begin{split}{\left( {\begin{array}{{20}{c}} x\\ y \end{array}} \right)_{ImagePlane}} = r*\left( {\begin{array}{{20}{c}} {{R_{21}}}\\ {{R_{31}}} \end{array}} \right)\end{split}$

In real life you face two obstacles that are not included in this simplified example:

Central Projection The image of the object is typically obtained using optics. In the simplest case, the optics consists of a single lens. The projection of an object through a lens into the image plane of a camera is not a parallel projection, but a central projection:

For a central projection, object distance $$S_1$$, focal length f, and image distance $$S_2$$ are related by the thin lens equation

$\frac{1}{{{S_1}}} + \frac{1}{{{S_2}}} = \frac{1}{f}$

For many practical applications, the objects are much further away than the focal length $$S_1 >> f$$ . The result: the image is located quite closely to the focal plane $${S_2} \approx f$$.

Note: If the image you acquire is obtained digitally (with CCD or CMOS image sensors), you get your image locations in pixels, not in millimeters. While this may sound like only a minor inconvenience, this conversion often leads to mistakes in the data analysis.

## Two DOF: 2) Targeting an Object in 3D¶

Let us look at an aerial gun, an object that is mounted like a Fick gimbal: the outermost rotation is always about an earth-vertical axis (Fig. below):

Take an aerial gun that in that starting position $$(\theta = 0/\phi = 0)$$ points straight ahead, i.e. along $$\vec{e_1}$$ . When a target appears at $$\vec P = (x/y/z)$$ , we want to re-orient the gun such that the rotated gun barrel, which after the rotation points in the direction of $$\vec{e'_1}$$ , points at the target. Taking the rotation matrix in Fick coordinates [eq:fullFick], with $$\psi = 0$$ , we get

$\begin{split}\mathbf{R}_{Fick}(\psi=0) = \left[ {\begin{array}{{20}{c}} \vec{e'_1}&\vec{e'_2}&\vec{e'_3} \end{array}} \right] = \left[ {\begin{array}{{20}{c}} {\cos {\theta _F}\cos {\phi _F}}&{ - \sin {\theta _F}}&{\cos {\theta _F}\sin {\phi _F}_F}\\ {\sin {\theta _F}\cos {\phi _F}}&{\cos {\theta _F}}&{\sin {\theta _F}\sin {\phi _F}}\\ { - \sin {\phi _F}}&0&{\cos {\phi _F}} \end{array}} \right]\end{split}$

With $$\vec{e'_1} = \frac{{\vec P}}{{\left| {\vec P} \right|}}$$ we get

$\begin{split}\begin{array}{l} \phi = - \arcsin \frac{{{P_z}}}{{\sqrt {{P_x}^2 + {P_y}^2 + {P_z}^2} }}\\ \theta = \arcsin \left( {\frac{{{P_y}}}{{\sqrt {{P_x}^2 + {P_y}^2 + {P_z}^2} }} \cdot \frac{1}{{\cos \phi }}} \right) \end{array}\end{split}$

### Two DOF 3) Projection onto a Flat Surface¶

Another frequent paradigm is a projection onto a flat surface. Consider the following practical problem:

You are located at a distance d in front of a flat surface, and want to look at a point P. Using rotation matrices for a combination of “horizontal” projection onto a flat surface, and “vertical” re-orientations, how far do you have to move “horizontally”, and how far “vertically”, and in which sequence, to look exactly at the desired location P?

Solution:These two sequences of rotation correspond to the rotations of the Fick-gimbal and of the Helmholtz-gimbal in Fig. 51 , respectively (with zero torsion about the line of sight). The line-of-sight corresponds to the $$\vec{e_1}$$ axis after the rotation, and the target point is the intersection of this axis with a plane parallel to the $${\vec h_2} - {\vec h_3}$$ at a distance d:

$\begin{split}\begin{array}{l} \vec P = (d/y/z)\\ \vec{e'_1} = \frac{{\vec P}}{{\left| {\vec P} \right|}} \end{array}\end{split}$

From that we can determine the corresponding Fick-angles as described for the aerial gun above. The Helmholtz-angles can be found similarly.

## Three DOF: 1) Induced Voltages¶

An interpretation of the values of the rotation matrix can be found by looking at Eqn. (2): the columns of the rotation matrix R are equivalent to the vectors of the object-fixed coordinate system $$\left[ {{{\vec e}_1}\,{{\vec e}_2}\,{{\vec e}_3}} \right]$$ expressed in the space-fixed coordinate system $$\left[ {{{\vec h}_1}\,{{\vec h}_2}\,{{\vec h}_3}} \right]$$ . Thus, different values in the rotation matrix R indicate a different orientation of the eye-fixed coordinate system, i.e. a different orientation of the eye-ball. For example, let us put an artificial eye-ball on a Fick-gimbal (Fig. Fig. #figgimbalsB), and turn the gimbal first 15:math:^circto the left and then (about the rotated axis $$\vec{e_2}$$ ) 25$$^\circ$$down, i.e. $$(\theta_F, \phi_F, \psi_F) = (15, 25, 0)$$. The orientation of the eye ball will then be given by the matrix

$\begin{split}{R_{Fick}} = \left[ {\begin{array}{{20}{c}} {0.88}&{ - 0.26}&{0.41}\\ {0.23}&{0.97}&{0.11}\\ { - 0.42}&0&{0.91} \end{array}} \right]\end{split}$

Putting an eye on a Helmholtz-gimbal (Fig. Fig. #figgimbalsC), and turning it first 25:math:^circdown, and then 15$$^\circ$$to the left (about the rotated axis $$\vec{e_3}$$ ), i.e. $$(\theta_H, \phi_H, \psi_H) = (15, 25, 0)$$, leads to a different orientation of the eye:

$\begin{split}{R_{Helmholtz}} = \left[ {\begin{array}{{20}{c}} {0.88}&{ - 0.23}&{0.42}\\ {0.26}&{0.97}&0\\ { - 0.41}&{0.11}&{0.91} \end{array}} \right]\end{split}$

The orientation of the eye is in both cases clearly different: for example, on the Fick-gimbal $$\vec{e_3}$$ is given by (0.41, 0.11, 0.91), whereas on the Helmholtz-gimbal it points in a different direction, (0.4, 0, 0.91).

Experimentally, the 3-dimensional orientation of the eye in space can be measured for example with induction coils. When an induction coil is put into an oscillating magnetic field $$\vec{B}$$ , a voltage is induced in the coil . If the coil is characterized by a coil-vector $$\vec{c}$$, which is perpendicular to the coil and has a length proportional to the surface surrounded by the coil, the voltage is proportional to the cosine of the angle between $$\vec{B}$$ and $$\vec{c}$$ . As pointed out by , this leads to a simple correspondence between the values of the rotation matrix and the voltages induced in search-coils.

This connection can be demonstrated with the experimental setup shown in Fig. 2.15:

Let

${\vec B_i} = {\vec h_i}\,{b_i}\,\sin ({\omega _i}\,t),\, i=1,2,3$

be three homogeneous orthogonal magnetic fields. They are parallel to the axes of the space-fixed coordinate system $$\left[ \vec{h_1}\,\vec{h_2}\,\vec{h_3}\right]$$, have amplitudes $$b_i$$, and oscillate at frequencies $$\omega_i$$ . Further, let $$\left[ {{{\vec h}_1}\,{{\vec h}_2}\,{{\vec h}_3}} \right]$$ denote three orthogonal coils which are parallel to the object-fixed coordinate system $$\left[ {{{\vec e}_1}\,{{\vec e}_2}\,{{\vec e}_3}} \right]$$ and firmly attached to the object (here the eye). Then the voltage induced by the magnetic field $$\vec{B_i}$$ in coil $$\vec{c_j}$$ ,$$V_{ij}$$, is given by

$V_{ij} = R_{ij} * b_i * \omega_i * cos(\omega_i*t) * c_j \, with i,j=1,2,3$

where $${c_j} = \left| {{{\vec c}_j}} \right|$$ indicates the length of the vector $$\vec{c_j}$$ . This gives a direct interpretation of the elements of the rotation matrix $$\mathbf{R}$$: the voltage induced by the magnetic field $$\vec{B_i}$$ in the coil $$\vec{c_j}$$ is proportional to the element $$R_{ij}$$ of the rotation matrix $$\mathbf{R}$$, which describes the rotation from the reference position, where the coils $$\left[ {{{\vec c}_1}\,{{\vec c}_2}\,{{\vec c}_3}} \right]$$ line up with the magnetic fields $$\left[ \vec{B_1}\,\vec{B_2}\,\vec{B_3}\right]$$, to the current position.

Note that for the determination of the 3D orientation, three matrix elements suffice: H, V, and T indicate the signals that approximately represent the horizontal, vertical, and torsional orientation of the object.

$\begin{split}R = \left[ {\begin{array}{{20}{c}} - & - & -\\ H &{{T_2}}& - \\ V & T & - \end{array}} \right]\end{split}$

## Three DOF: 2) CT Scanner¶

Another good example of a device that requires 3D kinematics are modern CT scanners.

Question: If you know the orientation of the desired image plane, how do you find the corresponding angles $$(\alpha, \beta, \gamma)$$ ?

Answer: For the scanner shown in the Figure above, the full rotation matrix is given by

$\mathbf{R} = \mathbf{R_3}(\alpha) \cdot \mathbf{R_1}(\beta) \cdot \mathbf{R_2}(\gamma)$

If you know the desired orientation, you can determine the corresponding angles.

Describing 3-dimensional orientation as such an arbitrary sequence of multiple rotations has the inherent disadvantage that different sequences lead to different horizontal, vertical, and torsional values for the same orientation. However, Euler’s theorem tells us that any eye position can be reached from the reference position by a single rotation about a fixed axis. The next section will deal with rotation vectors and quaternions, which characterize this single rotation from the reference orientation to a new orientation.