Compare two transform orders on the same triangle and see that the results differ.

Example

Compare S R and R S to see why transform order changes the result.

highlighted = computed this step

Step 1 — Set up

Set up rotation and scale; rightmost matrix acts first.

R=[010100001]S=[200010001]R=\begin{bmatrix}0&-1&0\\1&0&0\\0&0&1\end{bmatrix}\qquad S=\begin{bmatrix}2&0&0\\0&1&0\\0&0&1\end{bmatrix}
Composition order comparisonThe same triangle transformed by S R and R S, producing different results.

Step 2 — Compose both orders

Multiply in both orders; the products differ.

SR=[020100001]RS=[010200001]\begin{aligned}S R&=\begin{bmatrix}0&-2&0\\1&0&0\\0&0&1\end{bmatrix}\\R S&=\begin{bmatrix}0&-1&0\\2&0&0\\0&0&1\end{bmatrix}\end{aligned}
Composition order comparisonThe same triangle transformed by S R and R S, producing different results.

Step 3 — Compare vertex A

Apply both orders to vertex A.

(SR)A=[111][211](RS)A=[111][121]\begin{aligned}(S R)A&=\begin{bmatrix}1\\1\\1\end{bmatrix}\to\hlmath{\begin{bmatrix}-2\\1\\1\end{bmatrix}}\\(R S)A&=\begin{bmatrix}1\\1\\1\end{bmatrix}\to\hlmath{\begin{bmatrix}-1\\2\\1\end{bmatrix}}\end{aligned}
Composition order comparisonThe same triangle transformed by S R and R S, producing different results.A' SRA' RS

Step 4 — Compare vertex B

Apply both orders to vertex B.

(SR)B=[311][231](RS)B=[311][161]\begin{aligned}(S R)B&=\begin{bmatrix}3\\1\\1\end{bmatrix}\to\hlmath{\begin{bmatrix}-2\\3\\1\end{bmatrix}}\\(R S)B&=\begin{bmatrix}3\\1\\1\end{bmatrix}\to\hlmath{\begin{bmatrix}-1\\6\\1\end{bmatrix}}\end{aligned}
Composition order comparisonThe same triangle transformed by S R and R S, producing different results.A' SRB' SRA' RSB' RS

Step 5 — Compare vertex C

Apply both orders to vertex C.

(SR)C=[121][411](RS)C=[121][221]\begin{aligned}(S R)C&=\begin{bmatrix}1\\2\\1\end{bmatrix}\to\hlmath{\begin{bmatrix}-4\\1\\1\end{bmatrix}}\\(R S)C&=\begin{bmatrix}1\\2\\1\end{bmatrix}\to\hlmath{\begin{bmatrix}-2\\2\\1\end{bmatrix}}\end{aligned}
Composition order comparisonThe same triangle transformed by S R and R S, producing different results.A' SRB' SRC' SRA' RSB' RSC' RS

Step 6 — Result

The two composite orders make different triangles.

SRRSS R\ne R S
Composition order comparisonThe same triangle transformed by S R and R S, producing different results.A' SRB' SRC' SRA' RSB' RSC' RS
compose-order-matters With column vectors, the rightmost matrix acts first. Scaling after rotation and rotating after scaling can produce different shapes.