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

reflect A reflection matrix flips the sign of the coordinate perpendicular to the mirror axis.

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=[100−1]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′=[100−1][11]=[1⋅1+0⋅10⋅1+(−1)⋅1]=[1−1]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′=[100−1][31]=[1⋅3+0⋅10⋅3+(−1)⋅1]=[3−1]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′=[100−1][12]=[1⋅1+0⋅20⋅1+(−1)⋅2]=[1−2]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'