# Know if a 4x4 matrix is a composition of rotations and translations (quaternions)

I am using quaternions to describe 3D transformations. A position in space is representated by a (x,y,z,1) vector, and a transformation by a 4x4 matrix, following quaternions logics as far as I could understand it.

Is there a name for 4 x 4 matrix obtained by combinations of translations and rotations, more precisely a spatial transformation that conserves lengths? (no scaling, no projection) Is there a formula to identify such transformations on any 4x4 matrix?

• Are you just asking about $SO(4)$? Dec 5, 2014 at 15:50
• I am just asking the question on a basic point of view, using quaternions as the "popular tool" to handle space transformations in 3D. And sorry, I don't know the precise definition of $SO(4)$ Dec 5, 2014 at 16:49

It's called a "rigid motion". To detect whether a 4x4 matrix, operating on homogeneous $4 \times 1$ coordinate tuples, represents a rigid motion...
1. Check that the bottom row is $\begin{bmatrix}0& 0& 0 &s\end{bmatrix}$, with $s \ne 0$.
2. Let $A$ denote the upper left $3 \times 3$ matrix, and compute $A^T A$; if it's not $s^2 I$, then you don't have a rigid motion. If it is, then you have a rigid motion.
3. Check $\det A > 0$; if that's true, then you have an orientation-preserving rigid motion; otherwise, you've got an orientation-reversing one (but following it by reflection through the $xy$-plane, say, will make it orientation-preserving.
• Thank you for this quick answer ! Would it be safe (very open question) to force $s = 1$ ? Dec 5, 2014 at 15:58
• Almost everything we do (in graphics, at least) has $s = 1$; I just wanted to be sure my answer covered the case where it was not. Since every rigid motion can indeed be represented by SOME matrix with $s = 1$, I think that requiring that is pretty reasonable in a lot of cases. Dec 5, 2014 at 17:08
• Ok, thanks again. I will also use $s=1$. I would say that if you don't, you must take into account a kind of "normalization" with $s$. Dec 8, 2014 at 12:03
• Yes, and that "normalization" is what we mean by "operates on homogeneous $4 \times 1$ coordinate tuples," i.e., on coordinate tuples $\begin{bmatrix} x& y & z & w\end{bmatrix}$ in which \begin{bmatrix} cx& cy & cz & cw\end{bmatrix}$(for$c \ne 0$)$ is "the same point". Most computer graphics programs stick with $w = 1$, but if you want to include projective maps (like the camera transform) into your matrix formulation, you have to accept that sometimes a matrix will produce an output with $w \ne 1$, and you'll have to divide through by $w$, which graphics folks wrongly call "homogenizing". Dec 8, 2014 at 12:42