Rotations: figuring out what a rotation does

I want to write a short emphatic post making one major point. I’ve made it before, but I think it needs to be hammered home.

In addition to the links in this post, you could use the Tag Cloud to find related posts.

I mentioned in this happenings post, near the end, that I had found a nice introductory book on the control of aircraft (Thomas Yechout et al., “Introduction to Aircraft Flight Mechanics…”, AIAA 2003, ISBN 1-56347-4344).

I looked at it yesterday morning. I was planning to spend the day working on the next regression post … and I did … but I figured I’d turn my kid loose first, and he wanted to play in that book.

I still think it’s a nice book… but two of their drawings for rotations are mighty confusing… at first glance, they appear to be wrong. It turns out they are right, but the display is unusual.

I’ve talked about this out before, but let me put it in a post all by itself. (This post seemed essential when I thought they had made a mistake; it is merely desirable once I saw that the reader had to take a careful look at their drawings.)

Suppose we are given the following rotation matrix…

Rz[\theta] = \left(\begin{array}{ccc} \cos (\theta ) & \sin (\theta ) & 0 \\ -\sin (\theta ) & \cos (\theta ) & 0 \\ 0 & 0 & 1\end{array}\right)
Read the rest of this entry »

Rotations: from one Euler angle sequence to another

Let’s suppose we are given an Euler angle sequence ZYX with angles

as = {0.2, 0.25, 0.3}

We have been asked to convert that to ZYZ.

(You probably want to have read the previous quaternion posts.) I will remind us that the notation ZYX means the rotation

Rx Ry Rz,

with the Z-axis rotation first; and I write the angles in the same order, ZYX,, so the given rotation is

m0 = Rx(.3) Ry(.25) Rz(.2).

We do not need to compute it, but we might as well; if for no better reason than that we will be able to check our answer. The rotation matrix for the given Euler angle sequence works out to:

m0 = \left(\begin{array}{ccc} 0.949599 & 0.192493 & -0.247404 \\ -0.118141 & 0.950819 & 0.286333 \\ 0.290353 & -0.242673 & 0.925637\end{array}\right)
Read the rest of this entry »

Rotations, especially Euler angle sequences

In this post, I simply want to play with the Euler angle representations of some rotations. This is not a thorough test suite, merely a handful of different cases:

  1. for a random rotation…
  1. ZYX
  2. ZXZ
  • ZXZ for…
    1. x-axis rotation
    2. y-axis rotation
    3. z-axis rotation
  • ZYX for…
    1. x-axis rotation
    2. y-axis rotation
    3. z-axis rotation

    A random orthogonal matrix

    In the previous post, we worked an example starting from a given Euler angle sequence of the form ZYX. This time, let’s begin with a random matrix. By issuing the command
    Read the rest of this entry »

    Quaternions and Rotations 2: Euler angles etc.

    Let me create a simple example. You may want to have read Quaternions and Rotations 1, and the introductory post as well.

    I will specify an Euler angle sequence, “ZYX”, with angles:

    The notation “ZYX” means that we first rotate about the z-axis, then about y, then about x; and I choose to let the angles be in the same order. This is typically used in aerospace applications. The other Euler angle sequence common in my experience is “ZXZ” for orbits. Altogether, I count 12 kinds: three choices for the first axis, two for the second, and two for the third. There is no point in choosing consecutive axes the same, because consecutive rotations about the same axis are equivalent to one rotation, through the sum of the angles, about that axis.

    The obvious first step is to construct the combined rotation matrix for that Euler angle sequence, but I’m going to go in a different order. I’m going to test all 8 transformations among rotation matrices, angle/axis, quaternion, and Euler angle sequences.

    What the heck? Pictures are good.

    Read the rest of this entry »

    Quaternions and Rotations 1

    What I’m heading for is to compute the following eight transformations (shown by arrows) among representations of a 3D rotation.

    Let me begin by talking about rotations generally (see rotations 1 for more detail).
    Read the rest of this entry »

    Quaternions: introduction


    Let me start by listing three references, none of which has everything I would want.

    1. Kuipers’ “Quaternions and Rotation Sequences” is on my bibliographies page.
    2. Kantor and Solodovnikov’s “Hypercomplex Numbers: An Elementary Introduction to Algebras” (Springer 1989, 0 387 96980 2) puts quaternions in the context of number systems.
    3. Pertti Lounesto’s “Clifford Algebras and Spinors” (Cambridge 1997, 0 521 59916 4) had one result I wanted, namely a complex matrix representation. I wouldn’t recommend this book for quaternions, but I find it indispensible for clifford algebras.

    Quaternions were invented by William Rowan Hamilton on October 16, 1843. He may have considered them the greatest achievement of his rather stellar mathematical career. He had been looking for a 3D analog of the complex numbers; we know today that the properties he was hoping to find can only hold in dimensions 1,2,4,8. (They give us the real numbers, the complex numbers, the quaternions, and the octonions.)

    The simplest way to define a quaternion is to write

    q = a + b I + c J + d K,

    where a,b,c,d are real numbers, and the symbols I, J, K have the following properties:

    I^2 = J^2 = K^2 = I\ J\ K = -1\ .

    That should remind you of the complex numbers: z = a + b I, with I^2 = -1\ . We have two additional imaginary units, and there is one additional property relating all three of them.
    Read the rest of this entry »

    angle and axis of rotation 2: the two correct answers

    Edit 19 Sept 2010. I strongly recommend using the eigenvector rather than trying to make a unit vector out of the off-diagonal terms. Find “edit” below.

    Back in what has turned out to be my most popular post, axis and angle of rotation, I showed how to switch between the angle and axis of rotation and the rotation matrix.

    Given the axis of rotation as a unit vector (a, b, c), and the angle of rotation, we construct the matrix N

    N = \left(\begin{array}{lll} 0 & c & -b \\ -c & 0 & a \\ b & -a & 0\end{array}\right)

    and then we construct

    A = I + N sin \theta + N^2 \left(1-cos \theta \right)

    and that’s a rotation. To be specific, it is an attitude matrix for a rotation of coordinate axes, about the axis (a, b, c) through the angle \theta\ .
    Read the rest of this entry »

    rotating coordinate systems: examples 2 & 3

    2: released in rotating frame (linear motion, inertial frame)

    (See the previous post, example 1, for notation.)

    Suppose we are holding an object fixed on the merry-go-round at a distance R on the x-axis: it is stationary in the rotating frame. Now suppose that the surface is frictionless. We release the object at t= 0. What is it’s motion?

    At t = 0 we have initial values of \rho and \nu:

    \rho0 = \{R,\ 0,\ 0\}

    \nu0 = \{0,\ 0,\ 0\}

    We apply the transition matrix (setting t = 0; note that all axes coincide) to get initial r and v from initial \rho and \nu:

    r0 = T\ \rho0 = \{R,\ 0,\ 0\}

    v0 = T\ \nu0 - \omega\ N\ T\ \rho0 = \{0,\ R \omega ,\ 0\}

    (Yes, wrt the fixed frame, the initial position r0 is on the x-axis, and the initial velocity v0 is tangential, i.e. having only a y-component.)
    Read the rest of this entry »

    rotating coordinate systems: example 1

    conventions and setup

    As far as possible, I am going to stay with my notation. r and \rho are the old and new (fixed and rotating) components of the position vector; v and \nu are derivatives wrt time of r and \rho respectively; a and \alpha are derivatives wrt time of v and \nu respectively. (But R is a convenient scalar value, and will no longer denote the position vector whose components are r and \rho\ .)

    v = \dot{r}

    \nu = \dot{\rho}

    a = \dot{v}

    \alpha = \dot{\nu}

    The rotating frame is the same in all these problems, so get its matrices early (hence not often). The z-axis is our axis of rotation.

    The attitude matrix for a CCW rotation of the axes (about the z-axis) is…

    A = \left(\begin{array}{lll} \cos (t \omega ) & \sin (t \omega ) & 0 \\ -\sin (t \omega ) & \cos (t \omega ) & 0 \\ 0 & 0 & 1\end{array}\right)

    The transition matrix is… Read the rest of this entry »

    rotating coordinate systems: background

    I owe you derivations of three assertions. We will need a fourth one, too.

    1. matrix multiplication by N is equivalent to some vector cross product
    2. the transition matrix is T =  1 - \sin (\theta )\ N + (1-\cos (\theta ))\ N^2
    3. \dot{T} = - \omega\ N\ T\
    4. N^3 = -N

    matrix multiplication by N

    Read the rest of this entry »