Reflect a triangle across a coordinate axis using an exact 2x2 matrix.

Example

Reflect a triangle with an exact matrix across the x-axis.

highlighted = computed this step

Step 1 — Set up

Use column vectors with matrix times vertex.

M=[1001]M=\begin{bmatrix}1&0\\0&-1\end{bmatrix}
2D transform triangleA dim original triangle and transformed vertices computed from the algebra.

Step 2 — Move vertex A

Multiply the matrix by vertex A.

A=[1001][11]=[11+0101+(1)1]=[11]A'=\begin{bmatrix}1&0\\0&-1\end{bmatrix}\begin{bmatrix}1\\1\end{bmatrix}=\begin{bmatrix}1\cdot1+0\cdot1\\0\cdot1+\left(-1\right)\cdot1\end{bmatrix}=\hlmath{\begin{bmatrix}1\\-1\end{bmatrix}}
2D transform triangleA dim original triangle and transformed vertices computed from the algebra.A'

Step 3 — Move vertex B

Multiply the matrix by vertex B.

B=[1001][31]=[13+0103+(1)1]=[31]B'=\begin{bmatrix}1&0\\0&-1\end{bmatrix}\begin{bmatrix}3\\1\end{bmatrix}=\begin{bmatrix}1\cdot3+0\cdot1\\0\cdot3+\left(-1\right)\cdot1\end{bmatrix}=\hlmath{\begin{bmatrix}3\\-1\end{bmatrix}}
2D transform triangleA dim original triangle and transformed vertices computed from the algebra.A'B'

Step 4 — Move vertex C

Multiply the matrix by vertex C.

C=[1001][12]=[11+0201+(1)2]=[12]C'=\begin{bmatrix}1&0\\0&-1\end{bmatrix}\begin{bmatrix}1\\2\end{bmatrix}=\begin{bmatrix}1\cdot1+0\cdot2\\0\cdot1+\left(-1\right)\cdot2\end{bmatrix}=\hlmath{\begin{bmatrix}1\\-2\end{bmatrix}}
2D transform triangleA dim original triangle and transformed vertices computed from the algebra.A'B'C'

Step 5 — Result

The transformed triangle is complete.

transformed triangle complete\text{transformed triangle complete}
2D transform triangleA dim original triangle and transformed vertices computed from the algebra.A'B'C'
reflect A reflection matrix flips the sign of the coordinate perpendicular to the mirror axis.