[Math] Translation matrix without homogeneous coordinates

linear algebra

I am looking to translate a vector, and I found this article on wikipedia, which states that I need to use homogeneous coordinates to do so.

I don't get the reason why, and I don't really see how the result of the translation matrix with homogeneous coordinates is different from a translation matrix

$$ \matrix{T} =
\begin{bmatrix}
v_x & 0 & 0 \\
0 & v_y & 0 \\
0 & 0 & v_z \\
\end{bmatrix}
$$

so that with my vector $\vec{p} = [p_x \, p_y \, p_z]^T$ I'd get the translation as

$$
\vec{r}=\matrix{T}\vec{p}=
\begin{bmatrix}
v_x+p_x & 0 & 0 \\
0 & v_y+p_y & 0 \\
0 & 0 & v_z+p_z \\
\end{bmatrix}
$$

What is the reason for using the homogeneous coordinates instead of the above?

Best Answer

As you say, you don't really need to use homogeneous coordinates to represent translations. You can translate a point $\mathbf{p}$ by a vector $\mathbf{v}$ just by adding coordinates: $T(\mathbf{p}) = \mathbf{p} + \mathbf{v} = (p_x+v_x, p_y+v_y, p_z+v_z)$.

The benefit of using homogeneous coordinates and $4 \times 4$ matrices is that they give you a way to represent many different kinds of geometric transforms in a uniform way. Specifically, translations, rotations, scaling, shearing, and even central (perspective) projections can all be represented this way.

There are a couple of reasons this is valuable:

Firstly, if you need to compose transformations (perform several in succession, one after another), you can do this just by multiplying matrices. No special-case thinking is required. Life is tidier.

Secondly, if you're building graphics hardware, then all you need to do is create devices that can multiply $4 \times 4$ matrices, and these devices will then be able to perform a wide variety of different transformations, including all the ones that are needed in computer graphics. Hardware devices like uniformity.

Related Question