Shear a triangle horizontally with an exact 2x2 matrix.

Example

Shear a triangle horizontally with an exact matrix.

highlighted = computed this step

Step 1 — Set up

Use column vectors with matrix times vertex.

M=[1201]M=\begin{bmatrix}1&2\\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=[1201][11]=[11+2101+11]=[31]A'=\begin{bmatrix}1&2\\0&1\end{bmatrix}\begin{bmatrix}1\\1\end{bmatrix}=\begin{bmatrix}1\cdot1+2\cdot1\\0\cdot1+1\cdot1\end{bmatrix}=\hlmath{\begin{bmatrix}3\\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=[1201][31]=[13+2103+11]=[51]B'=\begin{bmatrix}1&2\\0&1\end{bmatrix}\begin{bmatrix}3\\1\end{bmatrix}=\begin{bmatrix}1\cdot3+2\cdot1\\0\cdot3+1\cdot1\end{bmatrix}=\hlmath{\begin{bmatrix}5\\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=[1201][12]=[11+2201+12]=[52]C'=\begin{bmatrix}1&2\\0&1\end{bmatrix}\begin{bmatrix}1\\2\end{bmatrix}=\begin{bmatrix}1\cdot1+2\cdot2\\0\cdot1+1\cdot2\end{bmatrix}=\hlmath{\begin{bmatrix}5\\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'
shear A shear moves one coordinate by a multiple of the other coordinate while leaving the other coordinate fixed.