Inverse of transformation matrix I am preparing for a computer 3D graphics test and have a sample question which I am unable to solve.
The question is as follows:
For the following 3D transfromation matrix M, find its inverse. Note that M is a composite matrix built from fundamental geometric affine transformations only. Show the initial transformation sequence of M, invert it, and write down the final inverted matrix of M.
$M =\begin{pmatrix}0&0&1&5\\0&3&0&3\\-1&0&0&2\\0&0&0&1\end{pmatrix} $
I only know basic linear algebra and I don't think it is the purpose to just invert the matrix but to use the information in the question to solve this. 
Can anyone help?
Thanks
 A: Here $4\times4$ matrix $M$ represents an affine transformation in 3D. It does so by conveniently combining a $3\times3$ matrix $P$ and a translation $v$ in a way that allows the affine transformation $Pu + v$ to be computed by a single matrix multiplication:
$$M  \begin{pmatrix} u \\ 1 \end{pmatrix} = \begin{pmatrix} Pu + v \\ 1 \end{pmatrix} $$
where $M = \begin{pmatrix} P & v \\ 0 & 1 \end{pmatrix}$.
It follows that "undoing" the affine transformation can be accomplished by multiplying by $M^{-1}$:
$$M^{-1} = \begin{pmatrix} P^{-1} & -P^{-1}v \\ 0 & 1 \end{pmatrix} $$
Given that $M = \begin{pmatrix} 0 & 0 & 1 & 5 \\ 0 & 3 & 0 & 3  \\ -1 & 0 & 0 & 2 \\
0 & 0 & 0 & 1 \end{pmatrix}$, one computes by any of a variety of ways:
$$M^{-1} = \begin{pmatrix} 0 & 0 & -1 & 2 \\ 0 & ^1/_3 & 0 & -1 \\ 1 & 0 & 0 & -5 \\
0 & 0 & 0 & 1 \end{pmatrix}$$
A: I know this is old, but the inverse of a transformation matrix is just the inverse of the matrix. For a transformation matrix $M$ which transforms some vector $\mathbf a$ to position $\mathbf v$, then to get a matrix which transforms some vector $\mathbf v$ to $\mathbf a$ we just multiply by $M^{-1}$
$M\cdot \mathbf a = \mathbf v \\
M^{-1} \cdot M \cdot \mathbf a = M^{-1} \cdot \mathbf v \\
\mathbf a = M^{-1} \cdot \mathbf v$
