stylistic:style_transfer
General matrix form of the transformations

All affine transformations of the plane can be described in a uniform way by using matrices. For this purpose, the coordinates (x, y) {\displaystyle (x,y)} of a point are commonly represented as the column matrix (x y). {\displaystyle {\begin{pmatrix}x\\y\end{pmatrix}}.} The result (x ′, y ′) {\displaystyle (x',y')} of applying an affine transformation to a point (x, y) {\displaystyle (x,y)} is given by the formula (x ′ y ′) = A (x y) + b, {\displaystyle {\begin{pmatrix}x'\\y'\end{pmatrix}}=A{\begin{pmatrix}x\\y\end{pmatrix}}+b,} where A = (A 1, 1 A 1, 2 A 2, 1 A 2, 2) {\displaystyle A={\begin{pmatrix}A_{1,1}&A_{1,2}\\A_{2,1}&A_{2,2}\end{pmatrix}}} is a 2×2 matrix and b = (b 1 b 2) {\displaystyle b={\begin{pmatrix}b_{1}\\b_{2}\end{pmatrix}}} is a column matrix. That is, x ′ = x A 1, 1 + y A 1, 1 + b 1 y ′ = x A 2, 1 + y A 2, 2 + b 2. {\displaystyle {\begin{aligned}x'&=xA_{1,1}+yA_{1,1}+b_{1}\\y'&=xA_{2,1}+yA_{2,2}+b_{2}.\end{aligned}}}

Among the affine transformations, the Euclidean transformations are characterized by the fact that the matrix A {\displaystyle A} is orthogonal; that is, its columns are orthogonal vectors of Euclidean norm one, or, explicitly, A 1, 1 A 1, 2 + A 2, 1 A 2, 2 = 0 {\displaystyle A_{1,1}A_{1,2}+A_{2,1}A_{2,2}=0} and A 1, 1 2 + A 2, 1 2 = A 1, 2 2 + A 2, 2 2 = 1. {\displaystyle A_{1,1}^{2}+A_{2,1}^{2}=A_{1,2}^{2}+A_{2,2}^{2}=1.}

This is equivalent to saying that A times its transpose is the identity matrix. If these conditions do not hold, the formula describes a more general affine transformation.

The transformation is a translation if and only if A is the identity matrix. The transformation is a rotation around some point if and only if A is a rotation matrix, meaning that it is orthogonal and A 1, 1 A 2, 2 − A 2, 1 A 1, 2 = 1. {\displaystyle A_{1,1}A_{2,2}-A_{2,1}A_{1,2}=1.}

A reflection or glide reflection is obtained when, A 1, 1 A 2, 2 − A 2, 1 A 1, 2 = − 1. {\displaystyle A_{1,1}A_{2,2}-A_{2,1}A_{1,2}=-1.}

Assuming that translations are not used (that is, b 1 = b 2 = 0 {\displaystyle b_{1}=b_{2}=0}) transformations can be composed by simply multiplying the associated transformation matrices. In the general case, it is useful to use the augmented matrix of the transformation; that is, to rewrite the transformation formula (x ′ y ′ 1) = A ′ (x y 1), {\displaystyle {\begin{pmatrix}x'\\y'\\1\end{pmatrix}}=A'{\begin{pmatrix}x\\y\\1\end{pmatrix}},} where A ′ = (A 1, 1 A 1, 2 b 1 A 2, 1 A 2, 2 b 2 0 0 1). {\displaystyle A'={\begin{pmatrix}A_{1,1}&A_{1,2}&b_{1}\\A_{2,1}&A_{2,2}&b_{2}\\0&0&1\end{pmatrix}}.} With this trick, the composition of affine transformations is obtained by multiplying the augmented matrices.