[Math] How to i represent 3D space using 4×4 matrix

3dmatrices

I want to represent 3D space using 4×4 matrix as we represent 2D plane using following form.

$$
\begin{bmatrix}
cos\theta & sin\theta & 0 \\
-sin\theta &cos\theta & 0 \\
x & y & 1 \\
\end{bmatrix}
$$

can 3D space be presented in 4×4 matrix?

how can i apply operations like rotation,translation and transformation to the object using this transformation matrix?

Best Answer

Matrices of the form $$ \begin{bmatrix} a&c&0\\ b&d&0\\ u&v&1 \end{bmatrix} $$ does not represent the $2D$-plane, but affine transformations in the $2D$-plane when the points of this space are represented by means of homogeneous coordinates $P=(x,y,1)$.

In this case the product $$ (x,y,1) \begin{bmatrix} a&c&0\\ b&d&0\\ u&v&1 \end{bmatrix}= (ax+by+u,cx+dy+v,1) $$ represents the combination of a linear transformation (given by the $2\times 2$ matrice with the terms $a,b,c,d$) and a translation given by $x,y$.

We can extend the use of homogeneous coordinates to any space $\mathbb{R}^n$ and in the case $n=3$ the points can be represented by a quadruple $P= (x,y,z,1)$ and a matrix of the form: $$ \begin{bmatrix} a&d&g&0\\ b&e&h&0\\ c&f&k&0\\ u&v&w&1 \end{bmatrix} $$ represents, in the same manner, a combination of a translation given by the vector $(u,v,w)$ and a linear transformation given by the $3\times 3$ matrices with the other entries.