This page supplements the previous coordinate transformation page
by focusing on the many ways to generate and interpret the transformation matrix, Q.
Remember, one more time, that the transform matrix rotates the coordinate system, not the object.
Quick Review
The transformation matrix, Q, is used in coordinate transformations of vectors
and tensors as follows.
where θ is the angle between the old and new axes. This is simply
a special case of the general 3-D case discussed below.
Transformation Matrix Properties
Transformation matrices have several special properties that, while easily seen in this
discussion of 2-D vectors, are equally applicable to 3-D applications as well.
This list is useful for checking the accuracy of a transformation matrix if questions
arise. While a matrix still could be wrong even if it passes all these checks,
it is definitely wrong if it fails even one!
- The determinant of Q equals one. - The transpose of Q is its inverse. - The dot product of any row or column with itself equals one. Ex: ( (\cos \theta ; {\bf i} + \sin \theta ; {\bf j}) \cdot
code
(\cos \theta \; {\bf i} + \sin \theta \; {\bf j}) = 1 \) - The dot product of any row with any other row equals zero. Ex: \( (\cos \theta \; {\bf i} + \sin \theta \; {\bf j}) \cdot
(-\sin \theta \; {\bf i} + \cos \theta \; {\bf j}) = 0 \) - The dot product of any column with any other column equals zero. Ex: \( (\cos \theta \; {\bf i} - \sin \theta \; {\bf j}) \cdot
(\sin \theta \; {\bf i} + \cos \theta \; {\bf j}) = 0 \) |
Recall from above that the dot product of any two different rows or columns of
a transformation matrix is zero, while the dot product of any row or column
with itself is one. This can be written in matrix and tensor notation as
Q⋅QT=Iandλikλjk=δij
This shows that the transpose of a transformation matrix is also
its inverse.
where (x′,x) represents the angle between the x′ and x axes,
(x′,y) is the angle between the x′ and y axes, etc.
3-D Reduction to 2-D
So a rotation about the z-axis means that cos(z′,z)=1 because
the angle between z′ and z remains 0°. Meanwhile,
cos(x′,z)=cos(y′,z)=cos(z′,x)=cos(z′,y)=0 because the
angles between these axes remains 90°.
The angle between x′ and y is (90∘−θ), and
cos(x′,y)=cos(90∘−θ)=sinθ.
Likewise, the angle between y′ and x is (90∘+θ), and
cos(y′,x)=cos(90∘+θ)=−sinθ.
where "x-comp of i′" means the x-component of the i′ unit vector.
Pay close attention here to which terms have primes on them and which don't.
Don't confuse this with "the x'-component" because "the x'-comp of i′"
is simply 1. Yet another way to say this is, "the first component of the i′
unit vector in the non-primed reference x,y,z coordinate system."
Transformation Webpage
This webpage performs coordinate transforms on 3-D tensors.
It also reports the transformation matrix. Try it out. Note that rotations on the webpage are
always about global axes, e.g., a rotation in the 1-2 plane will be about the 3-axis.
Successive Rotations - Roe Convention
The 3-D transformation matrix can be viewed as a series of three successive
rotations about coordinate axes. There must be dozens of variations of this
since any combination of axes can be chosen in any order to rotate about.
One popular choice is the so-called Roe convention.
As shown in the figure,
it consists of (i) a rotation through angle ψ about the z-axis, then
(ii) a rotation of angle θ
about the new y-axis (which has already rotated itself due to the first rotation
about z), and finally, (iii) a second rotation of ϕ about the now-tilted
z-axis.
The Roe convention is very popular despite one key challenge it contains. That
is... if θ=0, then ψ and ϕ become indistinguishable
and only the sum of the two is what matters.
Going In Reverse - Determining Roe Angles from a Matrix
Suppose you have a transformation matrix populated with values as shown here
and would like to know what Roe transformation angles were responsible
for producing the matrix.
UNLESS!!!....... θ proves to be very small!
In this case, sinθ will be very small and therefore, so will
q13,q23,q31, and q32 because all these terms contain sinθ.
This can lead to major round-off errors in any such calculations.
Fortunately, the solution for this (θ→0) is to recall that ψ and
ϕ become indistinguishable from each other. This permits ϕ to be set to zero, and
ψ to be computed according to ψ=Sin−1(q12).
Example: Roe Angles from Matrix
Let's start with the matrix in the previous example and work backwards.
Since θ is not near zero, ψ and ϕ can be computed as follows.
ψ=Tan−1(q31q32)=Tan−1(0.25000.4330)=60∘
ϕ=Tan−1(−q13q23)=Tan−1(0.35360.3536)=45∘
So as expected, the original values are recovered: ψ=60∘,θ=30∘,
and ϕ=45∘.
Rotation About An Axis
Yet another way of specifying the orientation of a transformed coordinate system is through
a rotation axis vector, p, and a rotation angle, α, about
the p axis.
In this case, the transformation matrix is written as
As usual, this can be written quite concisely in tensor notation
Qij=cosαδij+(1−cosα)pipj+sinαϵijkpk
It is very important to recognize that p is a unit vector. Using any
other length will lead to incorrect results.
Also, it's actually more common to use
θ or ϕ as the rotation angle instead of α. But
α is being used here to minimize confusion with
ψ,θ, and ϕ used as the Roe convention angles.
It is easy to visualize the coordinate rotations in this method. For example,
the 2-D case can be reproduced by noting that the rotation is about the z-axis,
so the vector is p=(0,0,1). This leads to
As with the Roe angles, it is possible to back-out p and α given
a transformation matrix, Q. The first step is to determine α.
This is done by taking the trace of the matrix.
α=Cos−1{21[tr(Q)−1]}
Once α is determined, the components of p are computed by
So the Roe angles ψ=60∘,θ=30∘,
and ϕ=45∘ are equivalent to a single rotation of
108∘ about the axis given by
p=(−0.0417, 0.3173, 0.9475).
Both sets lead to the new x′,y′,z′ axes pointing in the same
directions.
The above example closes the loop on converting rotations from one system, Roe,
to a second system, about an axis. In this case, and any other, the
transformation matrix Q is the go-between permitting the conversion.
The procedure is always to calculate the Q matrix in the first system
and then back-out the angles in the second system from Q.
Inverses and Transposes
All coordinate transformation matrices possess a rather remarkable
property - their transpose is their inverse. So it becomes trivial
to compute the inverse of such a matrix.
As hard as this and the previous page have been, there is still much more to tackle.
For starters, there is a very similar line of development for rotating
objects around in a fixed coordinate system... just the opposite of
what we have done here, which was rotating the coordinate system around
while the object itself remained fixed. This will be addressed in later sections.
We will see that the rotation matrix (no longer a transformation matrix)
is just the transpose/inverse of the transformation matrix.