# Rotations in nth Dimensional Space

1. Nov 28, 2009

### Bob65536

Let me start by saying I do not have a lot of background in linear algebra, but I'm not afraid of learning. I am working on a flash animation with action script. That does the following:
2. Add width so it turns into a line.
3. Rotate about the x-y plane 360 deg.
4. Add height so it turns into a square.
5. Rotate about the x-y plane 360 deg.
6. Add depth so it turns into a cube.
7. Rotate about the x-z plane 360 deg.
8. Add 4 dimensional length so it turns into a hypercube.
...
I plan on going up to about 10 dimensions before the animation ends.

I have to code to:
-Create the wire frame for an nth dimensional cube.
-Orthographic projection of the verticies into 2d space for drawing.
-Animate the new "dimension being added". The last component of the vector for each vertex starts at zero and approaches the correct value over time.

Basically the only thing I am missing is rotating the cube. I am having a hard time generalizing rotations into nth dimensional space. I came across an article on Wikipedia that looks promising at http://en.wikipedia.org/wiki/Rotation_matrix#Axis_of_a_rotation. The formula is:
$$R = \mathbf{u}\otimes\mathbf{u} + \cos\theta(1-\mathbf{u}\otimes\mathbf{u}) + \sin\theta[\mathbf u]_{\times}$$
where
R is the rotation matrix.
u is a unit vector.
$$\otimes$$ is the outer product.
$$[\mathbf u]_{\times}$$ is the skew symmetric form of u.

I do not understand though how you get the skew symmetric form of u. Reading the Wikipedia page on skew symmetric matrices does not help me understand how u goes from a vector to a square matrix. Does anybody have any tips or references that might help please?

Thanks!

2. Nov 29, 2009

### HallsofIvy

Staff Emeritus
In three-dimensions we can associate a vector with a skew-symmetric matrix. A 3 by 3 matrix generally has 9 entries. But for skew-symmetric, $a_{nm}= -a{mn}$ we must have $a_{nn}= -a_{nn}$ so all diagonal entries are 0. That leaves 9- 3= 6 entries and, once we have set, say, the 3 above the diagonal, the other 3 are fixed. That is, 3 by 3 skew-symmetric matrix has 3 independent entries, just like a 3- vector. The standard way of associating a skew-symmetric matrix to a vector is to associate the $n^{th}$ basis vector with the matrix having 0s along the $n^{th}$ column and row, -1 above the diagonal and 1 below. (-1 below the axis and 1 above would also give rotations about the vector as axis but with reversed direction.)

Specifically, $\vec{i}$ maps to the matrix
$$\begin{bmatrix}0 & 0 & 0 \\0 & 0 & -1 \\ 0 & 1 & 0\end{bmatrix}$$

$\vec{j}$ maps to the matrix
$$\begin{bmatrix}0 & 0 & -1 \\0 & 0 & 0 \\ 1 & 0 & 0\end{bmatrix}$$

$\vec{k}$ maps to the matrix
$$\begin{bmatrix}0 & -1 & 0 \\ 1 & 0 & 0 \\0 & 0 & 0\end{bmatrix}[/itex] And so a general vector, $a\vec{i}+ b\vec{j}+ c\vec{k}$ maps to [tex]a\begin{bmatrix}0 & 0 & 0 \\0 & 0 & -1 \\ 0 & 1 & 0\end{bmatrix}+ b\begin{bmatrix}0 & 0 & -1 \\0 & 0 & 0 \\ 1 & 0 & 0\end{bmatrix}+ c\begin{bmatrix}0 & -1 & 0 \\ 1 & 0 & 0 \\0 & 0 & 0\end{bmatrix}$$$$= \begin{bmatrix}0 & -c & -b \\ c & 0 & -a \\ b & a & 0 \end{bmatrix}$$