Example
Use a 3x3 homogeneous matrix to translate a triangle.
highlighted = computed this step
Step 1 — Set up
Use the homogeneous matrix; translation is matrix multiplication now.
M = [ 1 0 2 0 1 − 1 0 0 1 ] M=\begin{bmatrix}1&0&2\\0&1&-1\\0&0&1\end{bmatrix} M = 1 0 0 0 1 0 2 − 1 1
Homogeneous transform plot A dim original triangle and transformed vertices computed from homogeneous matrices.
Step 2 — Move vertex A
Translate vertex A with the matrix.
A ′ = [ 1 0 2 0 1 − 1 0 0 1 ] [ 1 1 1 ] = [ 1 ⋅ 1 + 0 ⋅ 1 + 2 ⋅ 1 0 ⋅ 1 + 1 ⋅ 1 + ( − 1 ) ⋅ 1 0 ⋅ 1 + 0 ⋅ 1 + 1 ⋅ 1 ] = [ 3 0 1 ] \begin{aligned}A'&=\begin{bmatrix}1&0&2\\0&1&-1\\0&0&1\end{bmatrix}\begin{bmatrix}1\\1\\1\end{bmatrix}\\&=\begin{bmatrix}1\cdot1+0\cdot1+2\cdot1\\0\cdot1+1\cdot1+\left(-1\right)\cdot1\\0\cdot1+0\cdot1+1\cdot1\end{bmatrix}\\&=\hlmath{\begin{bmatrix}3\\0\\1\end{bmatrix}}\end{aligned} A ′ = 1 0 0 0 1 0 2 − 1 1 1 1 1 = 1 ⋅ 1 + 0 ⋅ 1 + 2 ⋅ 1 0 ⋅ 1 + 1 ⋅ 1 + ( − 1 ) ⋅ 1 0 ⋅ 1 + 0 ⋅ 1 + 1 ⋅ 1 = 3 0 1
Homogeneous transform plot A dim original triangle and transformed vertices computed from homogeneous matrices. A'
Step 3 — Move vertex B
Translate vertex B with the matrix.
B ′ = [ 1 0 2 0 1 − 1 0 0 1 ] [ 3 1 1 ] = [ 1 ⋅ 3 + 0 ⋅ 1 + 2 ⋅ 1 0 ⋅ 3 + 1 ⋅ 1 + ( − 1 ) ⋅ 1 0 ⋅ 3 + 0 ⋅ 1 + 1 ⋅ 1 ] = [ 5 0 1 ] \begin{aligned}B'&=\begin{bmatrix}1&0&2\\0&1&-1\\0&0&1\end{bmatrix}\begin{bmatrix}3\\1\\1\end{bmatrix}\\&=\begin{bmatrix}1\cdot3+0\cdot1+2\cdot1\\0\cdot3+1\cdot1+\left(-1\right)\cdot1\\0\cdot3+0\cdot1+1\cdot1\end{bmatrix}\\&=\hlmath{\begin{bmatrix}5\\0\\1\end{bmatrix}}\end{aligned} B ′ = 1 0 0 0 1 0 2 − 1 1 3 1 1 = 1 ⋅ 3 + 0 ⋅ 1 + 2 ⋅ 1 0 ⋅ 3 + 1 ⋅ 1 + ( − 1 ) ⋅ 1 0 ⋅ 3 + 0 ⋅ 1 + 1 ⋅ 1 = 5 0 1
Homogeneous transform plot A dim original triangle and transformed vertices computed from homogeneous matrices. A' B'
Step 4 — Move vertex C
Translate vertex C with the matrix.
C ′ = [ 1 0 2 0 1 − 1 0 0 1 ] [ 1 2 1 ] = [ 1 ⋅ 1 + 0 ⋅ 2 + 2 ⋅ 1 0 ⋅ 1 + 1 ⋅ 2 + ( − 1 ) ⋅ 1 0 ⋅ 1 + 0 ⋅ 2 + 1 ⋅ 1 ] = [ 3 1 1 ] \begin{aligned}C'&=\begin{bmatrix}1&0&2\\0&1&-1\\0&0&1\end{bmatrix}\begin{bmatrix}1\\2\\1\end{bmatrix}\\&=\begin{bmatrix}1\cdot1+0\cdot2+2\cdot1\\0\cdot1+1\cdot2+\left(-1\right)\cdot1\\0\cdot1+0\cdot2+1\cdot1\end{bmatrix}\\&=\hlmath{\begin{bmatrix}3\\1\\1\end{bmatrix}}\end{aligned} C ′ = 1 0 0 0 1 0 2 − 1 1 1 2 1 = 1 ⋅ 1 + 0 ⋅ 2 + 2 ⋅ 1 0 ⋅ 1 + 1 ⋅ 2 + ( − 1 ) ⋅ 1 0 ⋅ 1 + 0 ⋅ 2 + 1 ⋅ 1 = 3 1 1
Homogeneous transform plot A dim original triangle and transformed vertices computed from homogeneous matrices. A' B' C'
Step 5 — Result
The transformed triangle is complete.
transformed triangle complete \text{transformed triangle complete} transformed triangle complete
Homogeneous transform plot A dim original triangle and transformed vertices computed from homogeneous matrices. A' B' C'
translate-as-matrix
In homogeneous coordinates, translation is a matrix multiplication. The result matches vector addition from the earlier translation lesson.