This article is part 4 in the series about transformation matrices:

2D translation

A translation is an affine transformation which is a linear transformation followed by some displacement

v=Mv+b

Even though we can’t express 2D translation using a 2x2 matrix, we can express such a transformation as a shearing transformation in 3D projective geometry , to do so we have to imagine that the 2D Euclidean world exists as the plane w=1 in a 3D space, under this geometry any point has the form [xy1]

In Euclidean geometry a vector expressed as a linear combination of the standard basis has the form

v=vxi^+vyj^=[vxvy]T

In Projective geometry a vector which exists in the plane w=1 has the form

v=vxi^+vyj^+1w^=[vxvy1]T

This basis can be represented using the following transformation matrix

M=[100010001]=[i||j||w||]

The translation transform then can be seen in Projective geometry as a simple shearing of the space by the coordinate w, using the shearing transform Hxy(Δx,Δy) to transform a point v

v=Hxy(Δx,Δy)v=[10Δx01Δy001][vxvy1]=[vx+Δxvy+Δy1]

Now that we’re using perspective geometry to represent entities, let’s imagine a point p=[xy0] (a point that lies in the plane w=0), whenever this point is transformed by a transformation matrix we can notice that the translation components of the matrix are cancelled because of w=0, we can take advantage of this fact and represent vectors with this notation.

Let v be a point located in the plane w=0, applying the shearing operation Hxy(s,t) results in

v=Hxy(Δx,Δy)v=[10Δx01Δy001][vxvy0]=[vxvy0]

It’s important to note that this matrix multiplication is still a linear transformation and that this trick of translating 2D points is actually a shearing of the 3D projective plane

3D translation

Similarly to 2D a 3D translation can be represented as a shearing of the 4D projective hyperplane which has the form

T=Hxyz(Δx,Δy,Δz)=[100Δx010Δy001Δz0001]

When a 4D vector existing on the hyperplane w=1 is transformed with this matrix the result is

v=Hxyz(Δx,Δy,Δz)v=[100Δx010Δy001Δz0001][vxvyvz1]=[vx+Δxvy+Δyvz+Δz1]

The general 3D translation matrix is then denoted as

(1)T=[100Tx010Ty001Tz0001]=[I3×3T3×101×31]