Rotate a triangle about the origin using exact quarter-turn matrices.

Example

Use exact quarter-turn matrices to rotate a triangle about the origin.

highlighted = computed this step

Step 1 — Set up

Use column vectors with matrix times vertex.

M=[0110]M=\begin{bmatrix}0&-1\\1&0\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=[0110][11]=[01+(1)111+01]=[11]A'=\begin{bmatrix}0&-1\\1&0\end{bmatrix}\begin{bmatrix}1\\1\end{bmatrix}=\begin{bmatrix}0\cdot1+\left(-1\right)\cdot1\\1\cdot1+0\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=[0110][31]=[03+(1)113+01]=[13]B'=\begin{bmatrix}0&-1\\1&0\end{bmatrix}\begin{bmatrix}3\\1\end{bmatrix}=\begin{bmatrix}0\cdot3+\left(-1\right)\cdot1\\1\cdot3+0\cdot1\end{bmatrix}=\hlmath{\begin{bmatrix}-1\\3\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=[0110][12]=[01+(1)211+02]=[21]C'=\begin{bmatrix}0&-1\\1&0\end{bmatrix}\begin{bmatrix}1\\2\end{bmatrix}=\begin{bmatrix}0\cdot1+\left(-1\right)\cdot2\\1\cdot1+0\cdot2\end{bmatrix}=\hlmath{\begin{bmatrix}-2\\1\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'
rotate-quarter-turns Quarter turns use exact integer matrices, so every transformed vertex can be computed exactly.