6.4. Translation#
In the previous section we looked at how to rotate, reflect and scale a vector. To complete the movement of vectors in \(\mathbb{R}^2\) we need to be able to translate vectors.
(Translation)
The translation of a position vector \(\vec{u} \in \mathbb{R}^n\) by a translation vector \(\vec{t} \in \mathbb{R}^n\) is the linear transformation \(T(\vec{t}): \vec{u} \mapsto \vec{u} + \vec{t}\).
The problem we have here is what is the matrix representation of translation, i.e., in \(\mathbb{R}^2\) what is the matrix \(T\) that satisfies
A matrix \(T(\vec{t})\) does not exist which is independent of \(u_x\) and \(u_y\) so we can use a trick which makes use of homogeneous co-ordinates. A point is typically represented by Cartesian coordinates as \((x, y)\). Homogeneous coordinates extend this representation by introducing an additional coordinate, denoted as \(w\), to represent the point in homogeneous coordinates as \((wx, wy, w)\). To convert homogeneous co-ordinates to Cartesian co-ordinates we divide throughout by the additional co-ordinate \(w\), i.e.,
(Homogeneous co-ordinates)
The homogeneous co-ordinates of a point \(\vec{u}\) in \(\mathbb{R}^n\) expressed using the Cartesian co-ordinates is the \((n+1)\)-tuple \((w u_1, w u_2, \ldots, w u_n, w)\) where \(w \in \mathbb{R}\backslash \{0\}\).
We often set \(w=1\) when using homogeneous co-ordinates since this makes mapping from Cartesian co-ordinates easy, i.e.,
If we express a point in \(\mathbb{R}^2\) with Cartesian co-ordinates \((u_1, u_2)\) using the homogeneous co-ordinates \((u_x, u_y, 1)\) then we can find a \(3 \times 3\) translation matrix \(T(\vec{t})\) that satisfies
so
\(\mathbb{R}^2\))
(Translation inThe translation of the vector \(\vec{u} \in \mathbb{R}^2\) by the translation vector \(\vec{t} \in \mathbb{R}^2\) is
If \(\vec{u}\) is expressed using homogeneous co-ordinates then the transformation matrix for translation is
The inverse translation is to translate by \(-\vec{t}\), therefore
Translate the point with position vector \(\vec{u} = (2, 3)^\mathsf{T}\) by the vector \(\vec{t} = (3, -1)^\mathsf{T}\).
Solution
Expressing the position vector \(\vec{u} = \begin{pmatrix} 2 \\ 3 \end{pmatrix}\) using homogeneous co-ordinates we have \(\vec{u} = \begin{pmatrix} 2 \\ 3 \\ 1 \end{pmatrix}\).
The translation matrix is
Applying the transformation to \(\vec{u}\)
6.4.1. Combining rotation, reflection, scaling and translation transformation#
If we want to combine translation with rotation, reflection and scaling transformations in \(\mathbb{R}^2\) then we need all of the transformation matrices to be \(3 \times 3\) matrices. This is easily done by adding the third row and column of the identity matrix to \(Rot(\theta)\), \(Ref(\theta)\) and \(S(\vec{s})\) from equations (6.8), (6.10) and (6.11) , i.e.,
6.4.2. Applying a transformation to multiple vectors#
To apply transformation to multiple vectors in \(\vec{u}_1, \vec{u}_2, \ldots, \vec{u}_m \in \mathbb{R}^2\) which are expressed using homogeneous co-ordinates we form an \(3 \times m\) matrix \(U\) where each of these vectors form the columns of \(U\), i.e.,
Given an \(3 \times 3\) transformation matrix \(A\) we can apply this transformation to all of the vectors \(\vec{u}_1, \vec{u}_2, \ldots, \vec{u}_m\) using \(V = A \cdot U.\)
An isosceles triangle has the vertices with co-ordinates \((-1,-1)\), \((1,-1)\) and \((0,2)\). The triangle is transformed using the following transformations:
Scaled by a factor of 2 in both directions
Rotated by \(\pi/4\) anti-clockwise about the origin
Translated by the vector \(\vec{t} = (6,4)^\mathsf{T}\)
Calculate the co-ordinates of the triangle after each of these transformations has been applied and determine a transformation matrix that performs all three transformations at the same time.
Solution
Using homogeneous co-ordinates the vertices have position vectors \(\begin{pmatrix} -1 \\ -1 \\ 1 \end{pmatrix}\), \(\begin{pmatrix} 1 \\ -1 \\ 1 \end{pmatrix}\) and \(\begin{pmatrix} 0 \\ 2 \\ 1 \end{pmatrix}\). We can combine into a single matrix
Since we are scaling by a factor of 2 in both directions then the scaling vector is \(\vec{s} = \begin{pmatrix} 2 \\ 2 \end{pmatrix}\) so the scaling matrix is
Applying the scaling matrix to the homogeneous co-ordinates
We want to rotate by an angle of \(\frac{\pi}{4}\) so the rotation matrix is
Applying the rotating matrix to \(W\)
Finally we need to translate by the translation vector \(\vec{t} = \begin{pmatrix} 6 \\ 4 \end{pmatrix}\) so the translation matrix is
Applying the translation matrix to \(W\)
The single transformation matrix that performs the three transformations at the same time is
Checking that \(A \cdot V = X\):