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

    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 »