4.1 Orthogonal
Linear Transformations
Rotations are best approached via the concept of an orthogonal
linear transformation (OLT), which is defined to be a LT that
does not change lengths of vectors or angles between vectors. Put
another way, OLTs preserve dot products:
O(v1).O(v2) = v1.v2 (4.1)
Clearly reflections and rotations are OLTs, because both are
linear and neither changes the lengths of, or the angles between,
vectors.
Matrices representing OLTs relative to orthonormal bases have
special properties, and are called orthogonal matrices.
The column vectors of an orthogonal matrix are mutually
orthogonal and have magnitude 1, because they are the images,
under the OLT, of the orthogonal unit vectors in the orthonormal
basis. You can verify that the matrix computed in Example 3.1,
representing a rotation relative to an orthonormal basis, has
orthogonal column vectors of length 1.
This property can also be expressed as follows: If O is the
matrix of an OLT relative to an orthonormal basis then
O-1 = OT (4.2)
Proof. By Formulas (2.2) and (3.5), the component in the ith
row and jth column of OTO is the dot
product of the ith row of OT and the jth
column of O. That is, it is the dot product of the ith
and jth columns of O. If i = j, then the dot product
is the square of the magnitude of the ith column
vector of O, namely 1. If i = j, this dot product is 0 because
the ith and jth columns of O are orthogonal
to one another. Thus OTO = I. A similar argument shows
that OOT = I. |||
A 3-D OLT can be either a reflections or a rotations. The distinction is that rotations preserve handedness (ie a rotation cannot transform a right hand into a left hand) while reflections reverse it. What if you want to know whether some OLT in 3-D space is a reflection or a rotation? (If you find it hard to imagine yourself wanting this, pretend that kidnappers have seized your dog and you must distinguish reflections from rotations to fulfil their ransom demands). One test is the following: both rotations and reflections preserve dot products, as we saw in the definition of an OLT in Equation (4.1), but it can be shown that rotations also preserve cross products while reflections reverse them:
Rota(v) × Rota(w) = Rota(v × w), but (4.3)
Refl(v) × Refl(w) = -Refl(v × w).
For example, Rota(e1) × Rota(e2)
= Rota(e1 × e2) = Rota(e3).
But the more usual way, in linear algebra books, of
distinguishing between 3-D reflections and rotations is to say
that the determinant of a reflection is -1 while the
determinant of a rotation is 1. It's not worth our while to learn
much about determinants in general, but for a 3 by 3 matrix M,
the formula is especially simple:
detM = M(e1) . ( M(e2) × M(e3) ) (4.4)
That is, the first column, dotted with the cross product of
the other two columns in order, gives the determinant. If the
matrix represents an OLT, the determinant must be -1 or 1; the
sign tells you whether the OLT is a reflection or a rotation.
A rotation, therefore, is an OLT that preserves
handedness (ie an OLT with determinant 1). A rotation matrix
R is a matrix corresponding to a rotation. If the bases for the
matrix are orthonormal, then we have RTR = I.
Matrices corresponding to rotations in 3-D space have nine components (3 × 3). The requirements of orthogonality and preservation of handedness reduce this set of matrices from nine degrees of freedom to three. This means that three numbers, such as the Bechert angles (see Section 4.4), suffice to describe 3-D rotations. But this does not mean that every (or even any) set of 3 elements from a rotation matrix determines that matrix. For example, the two different rotation matrices below:
1 0 0 -1 0 0 0 1 0 0 1 0 0 0 1 0 0 -1
have seven corresponding elements in common; thus knowing even
seven elements of a rotation matrix does not always tell you what
rotation matrix you have. But it can be shown that if you know
six elements that form two complete rows or two complete columns,
then the matrix is specified. This, essentially, is why two eye
coils in two magnetic fields, yielding four components of the
rotation matrix of the eye, do not suffice, in general, for the
computation of eye position. Two coils in three fields, yielding
two complete columns of the rotation matrix, do suffice.
4.2 The Rotation Group
Note the following facts: 1. The composition of two rotations
is always another rotation (it is never a reflection, say, or a
two-headed mule). 2. The identity transformation I can be
regarded as a rotation, namely the null rotation, which leaves
everything fixed. 3. Every rotation has a unique inverse,
namely the rotation of equal size in the opposite direction. A
set of objects that compose associatively with one another, and
that includes an identity element and an inverse for every
element, is called a group. This is a much simpler
algebraic notion than a vector space, and is very widely
applicable. In particular, we have just shown that the set of
rotations in an n-dimensional space is a group in which the
combining operation is composition. The set of all rotation matrices
for a given space is a group in which the combining operation is
matrix multiplication. Ultimately, it is the correspondence
between these two groups that makes rotation matrices useful in
the study of rotations.
Problem 4.1 Is the set of all 3-D reflections a group? If not,
which of the group axioms 1-3 from the last paragraph fail?
4.3 Application
For us, rotation matrices mainly provide a stepping stone to a
more useful representation of rotations using quaternions (coming
soon). However, for some purposes, rotation matrices are better
than quaternions. As a rule, quaternions are useful for composing
rotations and for questions involving rotation axes, but rotation
matrices are better (simply because the formula is slightly
simpler) for computing the effect of a given rotation on a given
vector. In this section we'll look at examples of this last
application.
Example 4.1 Rotation matrices are useful for computing how gaze
direction changes with eye rotation. Suppose we represent the
direction of gaze using a unit vector g (the gaze vector)
pointing in the direction of regard. If the eye undergoes a
rotation R, g will rotate with the eye, and the new gaze
direction will be [R][g]. For example, suppose g is
initially (.71, .5, .5) relative to an orthonormal head-fixed
basis with e1 forward, e2
left and e3 up; that is, g points mostly
forward but also left and up. And suppose the eye rotates 30° up
in the head. Then the matrix for this rotation relative the basis
ei is
cos30 0 -sin30 .87 0 -.5 0 1 0 = 0 1 0 sin30 0 cos30 .5 0 .87
and so [R][g] = ( (.87)(.71) - (.5)(.5), (1)(.5),
(.5)(.71) + (.87)(.5) ) = (.36, .5, .79).
4.4 How We Compute the Rotation
Matrix of the Eye
We now have enough math to explain our algorithm for computing
the rotation matrix of the eye from coil signals.
1. As Problem 2.5 indicates, the signal coming from an eye coil
in a magnetic field is the dot product c.m of a
vector c orthogonal to the coil plane and a vector m
in the direction of the field.
2. Now suppose the three magnetic field vectors m1,
m2 and m3 form an orthonormal
basis for 3-D space, meaning that they all have magnitude 1 (ie
all the fields have the same strength, which we regard as
"1") and they are mutually orthogonal. Then the three
signals from a coil vector c:
c.m1 c.m2 c.m3 (4.5)
are the three coordinates of the vector c with respect
to the basis formed by the mi. (Would this
still be so if the three magnetic fields were not mutually
orthogonal?).
3. The six signals from two eye coils on one eye are therefore
the coordinates of two unit vectors, c1 and c2,
fixed on the eye. These two vectors suffice to uniquely determine
the rotational position of the eye; (why would one vector not
suffice?). Klaus Bechert's microprocessor uses these vector
components to compute a 3-number representation of eye
orientation, similar to the "Euler angles" used by some
physicists, so that the data can be stored compactly in three
channels on disk. The details of this 3-number representation are
probably not vital for you, since the first thing that OMNIVOR
does, on reading the data files, is to reconstruct the vectors c1
and c2. More precisely, the subprogram SAMPLE
reads in the stored data and multiplies them by a conversion
factor to get the "Bechert angles" in radians; the
three Bechert angles of the eye are called av(i), and those of
the head hv(i). The subprogram CALCOIL (meaning CALculate COIL
vectors) then reconstructs the two unit vectors c1
and c2. Another subprogram then computes the
cross product of c1 and c2 to
get the coordinates, relative to the same mi
basis, of an imaginary third coil vector c3
orthogonal to c1 and c2.
4. By running OMNIVOR in "coil" mode and hitting the
key "d" , we choose a reference eye position, read the
Bechert angles for this position and compute the nine coordinates
of the three coil vectors, which in this position only we call c1,
c2 and c3.
5. Now suppose the eye has rotated away from reference position
by a rotation represented, in the mi basis, by
the rotation matrix R. Then clearly
ci = Rci for i = 1, 2 and 3 (4.6)
We can group the 3 c vectors together as the
columns of a 3 by 3 matrix C; and similarly the c
vectors form a 3 by 3 matrix C. Then we have
C = RC (4.7)
Or, multiplying both sides by the inverse of C -- one
can show that as long as c1 and c2
are not parallel (they are actually orthogonal in Skalar annuli
that we use), the matrix C in any eye position is invertible --
we obtain
R = CC-1. (4.8)
In OMNIVOR, the matrix C is computed and inverted, and
the inverse stored in a file, as soon as "i" is
punched. C-1 is called the D matrix in
the program, and the file containing the D matrix from the first
calibration for, say, subject 2 in experimental series eh is
called something like zeh21.d. (Actually, zeh21.d contains two D
matrices, one for the left eye and one for the head). The
subprogram that CALculates the D matrices is called CALD.
If you want to look at coil vectors, you choose menu options
"coils" in OMNIVOR; these variables are computed
without using any D matrix. For almost any other menu choice (eg
quaternions, velocity etc.), the rotation matrix of the eye (and
that of the head) must be calculated, and therefore the D
matrices are used. It is in subprogram CALQ (meaning CALculate
Quaternion) that the third coil vector c3 is
calculated, the matrix C is constructed, and the matrix
multiplication in Formula (4.8) is performed, though if you look
at CALQ you may not recognize this because some shortcuts are
taken to save time; for example, CALQ computes only the first two
components of c3, and it computes the third
column of R by taking the cross product of the first two columns.
Finally, CALQ converts the rotation matrix into a quaternion by a
formula that we haven't covered yet.
Suppose that A is a LT (not necessarily an OLT) from a vector
space V to itself, and that the equation
Av = sv (4.9)
holds for some vector v and some scalar s. In other
words, the effect of A on some vector v is simply to
multiply it by some scalar s. Then s is called an eigenvalue
of A, and v is called an eigenvector of A
corresponding to the eigenvalue s.
Most introductory texts on linear algebra describe techniques
for calculating the eigenvalues and corresponding eigenvectors of
a LT. We shall not cover these techniques because, while
eigenvectors are very important in our work, the quaternion
representation of rotations which we'll learn makes the
computation of important eigenvectors trivially easy. In the rest
of this section we'll examine the geometric significance of the
eigenvectors of 3-D OLTs.
Any 3-D reflection has two eigenvalues: -1 and 1. Any vector
orthogonal to the plane of the mirror is reversed in direction by
the reflection, without its size being changed; that is, the
reflected vector is -1 times the original, and so the vector is
an eigenvector corresponding to eigenvalue -1. The set formed by
all these eigenvectors is the line orthogonal to the plane of the
mirror. On the other hand, any vector in the plane of the mirror
is unchanged by the reflection: it is an eigenvector
corresponding to eigenvalue 1. The set formed by all these
eigenvectors is the plane of the mirror. Any vector that is
neither in the plane of the mirror nor orthogonal to it is not an
eigenvector of the reflection.
Any 3-D rotation has 1 for an eigenvalue: any vector lying
along the axis of the rotation is unchanged by the rotation, and
is therefore an eigenvector corresponding to eigenvalue 1. The
line formed by these eigenvectors is the axis of the
rotation. For the special case of the null rotation, every vector
in 3-D space is an eigenvector corresponding to eigenvalue 1.
Problem 4.2. Can you find a 3-D rotation with an eigenvalue
other than 1?