## 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

Let’s take two arbitrary vectors:

$a = \{a_1,\ a_2,\ a_3\}$

$b = \{b_1,\ b_2,\ b_3\}$

Replace the vector a by a skew matrix $N_a\$, using the same sign convention as for constructing N from a unit vector.

$N_a = \left(\begin{array}{lll} 0 & a_3 & -a_2 \\ -a_3 & 0 & a_1 \\ a_2 & -a_1 & 0\end{array}\right)$

I hope you’re ok that $N_a$ is what I would get if I made a unit vector $\hat{a}$ from a, made N from $\hat{a}$ in the usual way, and then multiplied N by the magnitude |a|: i.e. what we have is $N_a = |a|\ N\$, with N from the unit vector $\hat{a}\$.

Now compute the matrix product

$N_a\ b = \{a_3\ b_2-a_2\ b_3,\ a_1\ b_3-a_3\ b_1,\ a_2\ b_1-a_1\ b_2\}$

and the cross product

$a \times b = \{a_2\ b_3-a_3\ b_2,\ a_3\ b_1-a_1\ b_3,\ a_1\ b_2-a_2\ b_1\}$

One is the negative of the other:

$a \times b = -N_a\ b = - |a|\ N\ b$

$v = T\ \nu - \omega\ N\ r$

becomes a plus sign when we write the cross product form

$v = T\ \nu + \omega \times r\$.

Now compute the matrix product

$N_a\ N_a\ b = \left(\begin{array}{l} -b_1\ a_2^2+a_1\ b_2\ a_2-a_3^2\ b_1+a_1\ a_3\ b_3 \\ -b_2\ a_1^2+a_2\ b_1\ a_1-a_3^2\ b_2+a_2\ a_3\ b_3 \\ -b_3\ a_1^2+a_3\ b_1\ a_1+a_2\ a_3\ b_2-a_2^2\ b_3\end{array}\right)$

and the cross product

$a \times \left(a \times b\right) = \left(\begin{array}{l} -b_1\ a_2^2+a_1\ b_2\ a_2-a_3^2\ b_1+a_1\ a_3\ b_3 \\ -b_2\ a_1^2+a_2\ b_1\ a_1-a_3^2\ b_2+a_2\ a_3\ b_3 \\ -b_3\ a_1^2+a_3\ b_1\ a_1+a_2\ a_3\ b_2-a_2^2\ b_3\end{array}\right)$

They are the same:

$a \times \left(a \times b\right) = N_a^2\ b = |a|^2 N^2 b$

(That’s not surprising: two negatives give a positive.) Again, the minus sign in the matrix form

$a = T\ \alpha - 2\ \omega\ N\ T\ \nu + \omega^2\ N^2\ r$

$a = T\ \alpha + 2\ \omega \times \left(T\ \nu \right) + \omega \times \left(\omega \times r\right)$

but the $N^2$ term has the same sign as the double cross product. It is interesting that although the cross product is not associative, it corresponds to an associative matrix product. (Maybe I should remind us that $\omega \times \omega = 0\$, so the cross product in the other order is zero: $\left(\omega \times \omega\right)\times r = 0\$.

## show that $N^3 = -N$

(We are speaking of the N used to construct the attitude matrix for a rotation, not of the $N_a$ which corresponds to a cross product $a \times\$.)

There are a couple of ways to see that. We could just compute N^3, or we could guess why it’s true and confirm the guess. And my guess is that it comes from the characteristic polynomial of N.

So what is the characteristic polynomial of N? Write N as before:

$N = \left(\begin{array}{lll} 0 & \text{a3} & -\text{a2} \\ -\text{a3} & 0 & \text{a1} \\ \text{a2} & -\text{a1} & 0\end{array}\right)$

The characteristic equation for N (for any N) is

$\text{Det} \left(N - \lambda\ I\right) = 0\$.

For this N we get

$\lambda ^3+\text{a1}^2 \lambda +\text{a2}^2 \lambda +\text{a3}^2 \lambda$

which simplifies to

$\lambda ^3+\lambda =0$

because (a1, a2, a3) is a unit vector.

That’s the characteristic equation for N; we could solve it for $\lambda$ to find the eigenvalues, if that’s what we wanted. For our purpose, it is more important that the Cayley-Hamilton Theorem says that any matrix satisfies its own characteristic equation, so we have

$N^3+N = 0$

i.e.

$N^3 = -N\$,

and we will also need

$N^4 = -N^2\$.

Alternatively, we could simply compute N^3 for an arbitrary unit vector $\hat{a}\$. It’s not a bad idea anyway, especially since I knew before I worked out the algebra that the answer was supposed to be N^3 = -N. Algebra is perilous for me when I know the answer I want to get.

I’ll spare you the explicit computation: it works.

## the transition matrix

We know the following. If we describe the rotation axis by a unit vector $\hat{a} = \{a1, a2, a3\}$

and if we let N be defined as

$N = \left(\begin{array}{lll} 0 & \text{a3} & -\text{a2} \\ -\text{a3} & 0 & \text{a1} \\ \text{a2} & -\text{a1} & 0\end{array}\right)$

then the attitude matrix for the rotation is given by

$A = 1 + \sin (\theta )\ N + (1-\cos (\theta ))\ N^2$

I claim that the transition matrix $\left(T = A^T = A^{-1}\right)$ is

$T = 1 - \sin (\theta )\ N + (1-\cos (\theta ))\ N^2$

First, all I did was change the sign of $\theta\$: physically that’s the inverse rotation, hence also the transpose. It changed the sign of the sine but not of the cosine.

Second, we could get the same answer by reasoning instead that transposing A amounts to transposing N, but N is skew symmetric: $N^T = -N$ and $N^{2T} = N^2\$.

Third, we can confirm that A and the presumed T are inverses by direct computation.

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

which expands to

$\cos ^2(\theta ) N^4-2 \cos (\theta ) N^4+N^4-\sin ^2(\theta ) N^2-2 \cos (\theta ) N^2+2 N^2+I$

and since $N^4 = -N^2\$ that simplifies to the identity matrix:

$-\cos ^2(\theta ) N^2-\sin ^2(\theta ) N^2+N^2+I = I$

## the derivative of T

Let $\theta = \omega\ t\$ (we are rotating at constant angular speed $\omega$ about a constant axis of rotation); then T is

$T = 1 - \sin (\omega\ t )\ N + (1-\cos (\omega\ t ))\ N^2$

and its derivative is, by direct computation,

$\dot{T} = -N \omega\ \cos[\omega\ t]+N^2\ \omega\ \sin[\omega\ t]$

We want to show that

$-N \omega\ \cos[\omega\ t]+N^2\ \omega\ \sin[\omega\ t] = - \omega\ N\ T\$.

Where did that RHS come from? From the cross product formula: if the matrix form and the cross product form are the same (and they are!) that’s what $\dot{T}$ must be. So we verify the conjecture by computing the RHS (and using N^3 = -N).

$- \omega\ N\ T = -N \omega \left((1-\cos (\omega\ t)) N^2-\sin (\omega\ t) N+I\right)$

=

$-\omega N^3+\omega \cos (\omega\ t) N^3+\omega \sin (\omega\ t) N^2-\omega N$

=

$N^2 \omega \sin (\omega\ t)-N \omega \cos (\omega\ t)$

and that is the LHS.

## backstage

When I began working on this, I completely forgot to use the transition matrix; I used the attitude matrix, even while calling it the transition matrix! Still, I think all that did was mess up a sign.

Once I was finally looking at the two equations

$v = T\ \nu + \omega \times r$

and

$v = T \nu + \dot{T}\ \rho$

it was easy to conjecture that $\dot{T} \approx \omega\ N\ T\$. Attempting to confirm the equality immediately led me to N^3= -N; and the signs worked out beautifully when I remembered to compute and use the transition matrix. Oh, along the way I wrote the utterly false – false, I say! – $v = T\ \nu$ more times than I care to count.

So the order in which I did things was

• the derivative to within a sign: $\dot{T} = \pm\ \omega\ N\ T\$
• $N^3 = -N$
• the transition matrix
• confirm that one multiplication by N corresponds to the negative cross product; and two multiplications has the same sign as the cross product

Not the order in which they needed to be presented.

If it bothers you that this derivation and the resulting matrix forms are new to me, bear in mind that the cross product forms are tried-and-true; you can find them all over the place. They were the touchstone against which my matrix forms were tested.

Next, I hope to work some examples.