Use a 3x3 homogeneous matrix to translate every vertex of a triangle.

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=[102011001]M=\begin{bmatrix}1&0&2\\0&1&-1\\0&0&1\end{bmatrix}
Homogeneous transform plotA dim original triangle and transformed vertices computed from homogeneous matrices.

Step 2 — Move vertex A

Translate vertex A with the matrix.

A=[102011001][111]=[11+01+2101+11+(1)101+01+11]=[301]\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}
Homogeneous transform plotA dim original triangle and transformed vertices computed from homogeneous matrices.A'

Step 3 — Move vertex B

Translate vertex B with the matrix.

B=[102011001][311]=[13+01+2103+11+(1)103+01+11]=[501]\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}
Homogeneous transform plotA dim original triangle and transformed vertices computed from homogeneous matrices.A'B'

Step 4 — Move vertex C

Translate vertex C with the matrix.

C=[102011001][121]=[11+02+2101+12+(1)101+02+11]=[311]\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}
Homogeneous transform plotA 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}
Homogeneous transform plotA 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.