# Transformation Matrix (Plane Geometry)

In this article, I give examples of linear transformation that are used in plane geometry. The dilation, contraction, orthogonal projection, reflection, rotation, and vertical and horizontal shears are detailed. Towards the end, I combine them to produce some interesting linear transformation.

We give several examples of linear transformations on the real plane that are commonly used in plane geometry. The transformation matrix usually has a special name such as dilation, contraction, orthogonal projection, reflection, or rotation.

## Transformation Matrices: Dilation and Contraction

We give several examples of linear transformations from $\mathbb{R}^2$ to $\mathbb{R}^2$ that are commonly used in plane geometry.

Theorem. Let $T$ be a linear transformation from $\mathbb{R}^2$ to $\mathbb{R}^2.$ If the matrix of $T$ is of the form $$\begin{bmatrix} k & 0 \\ 0 & k \end{bmatrix}$$ then $T$ is a scaling transformation. If $k>1$ then the scaling is called a dilation, and is called a contraction when $k<1.$

Example. Is the linear transformation given by the system of linear equations $$\left\{ \begin{array}{l} y_1= 7x_1 \\ y_2 = 7x_2 \\ \end{array} \right.$$ from $\mathbb{R}^2$ to $\mathbb{R}^2$ a scaling?

Solution. The answer is yes since the matrix of the linear transformation is $$\begin{bmatrix} 7 & 0 \\ 0 & 7 \end{bmatrix}$$ which by definition is a scaling. For example, we can write $$T(x)=\begin{bmatrix} 7 & 0 \\ 0 & 7 \end{bmatrix} x.$$ We can use $T$ to dilate the vector $\begin{bmatrix}1\\ 2\end{bmatrix}$ by $7$ to obtain $$T\begin{bmatrix}1 \\ 2\end{bmatrix} =\begin{bmatrix} 7 & 0 \\ 0 & 7 \end{bmatrix}\begin{bmatrix}1 \\ 2\end{bmatrix} =\begin{bmatrix}7\\ 14\end{bmatrix}$$ as needed.

## Orthogonal Projection Transformations

Theorem. Let $T$ be a linear transformation from $\mathbb{R}^2$ to $\mathbb{R}^2.$ If the matrix of $T$ is of the form $$\frac{1}{w_1^2+w_2^2} \begin{bmatrix} w_1^2 & w_1 w_2 \ w_1 w_2 & w_2^2 \end{bmatrix}$$ then $T$ is an orthogonal projection transformation onto the line $L$ spanned by any nonzero vector $w = \begin{bmatrix} w_1 \\ w_2 \end{bmatrix}$ parallel to $L.$

Proof. Suppose line $L$ is spanned by $w.$ We can decompose any vector $x$ as $x^{||}+x^\perp$ as diagrammed: Notice $x^\perp$ is the perpendicular component so $$\label{perpeq} w \cdot x^\perp =0 \qquad \text{or equivalently} \qquad w \cdot (x -x^{||}) =0.$$ To project $x$ onto the line $L$ we notice $$\label{projfac} x^{||}=k w$$ for some scalar $k.$ By substitution solving for $k$ we obtain $$\label{facdef} k=\frac{w \cdot x}{w \cdot w}.$$ We define the orthogonal projection of a vector $x$ onto a given line $L$ as $$\label{projdef} \operatorname{proj}_L(x) =\frac{w \cdot x}{\left|\left| w \right|\right|}^2 w.$$ We would like to have the form of a matrix. To do so let $w=\begin{bmatrix}w_1\\ w_2\end{bmatrix}$ and $x=\begin{bmatrix}x_1\ x_2\end{bmatrix}.$ Then we find \begin{align*} \operatorname{proj}_L(x) & = \frac{1}{\left|\left| w\right|\right|^2} \left((x_1 w_1+x_2 w_2)\begin{bmatrix} w_1 \\ w_2\end{bmatrix} \right) \\ & = \frac{1}{\left|\left| w\right|\right| ^2} \left((x_1 w_1\begin{bmatrix} w_1 \\ w_2\end{bmatrix}+x_2 w_2 \begin{bmatrix}w_1 \\ w_2\end{bmatrix} \right) \\ & = \frac{1}{\left|\left| w\right|\right|^2} \left(\begin{bmatrix}x_1 w_1^2 \\ x_1w_1 w_2\end{bmatrix} + \begin{bmatrix} x_2w_1w_2 \\ x_2w_2^2\end{bmatrix} \right) \\ & = \frac{1}{\left|\left|w\right|\right|^2} \begin{bmatrix} x_1 w_1^2+x_2w_1w_2 \\ x_1w_1 w_2+x_2w_2^2\end{bmatrix} = \frac{1}{\left|\left|w\right|\right|^2} \begin{bmatrix} w_1^2 & w_1 w_2 \\ w_1 w_2 & w_2^2 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2\end{bmatrix} \end{align*} as desired.

Example. Find the matrix $A$ of the orthogonal projection onto the line $L$ spanned by $w = \begin{bmatrix} 4 \\ 3 \end{bmatrix}$ and project the vector $u=\begin{bmatrix} 1\\ 5\end{bmatrix}$ onto the line $L$ spanned by $w.$

Solution. The matrix is $$A=\frac{1}{w_1^2+w_2^2} \begin{bmatrix} w_1^2 & w_1 w_2 \\ w_1 w_2 & w_2^2 \end{bmatrix} =\frac{1}{25} \begin{bmatrix} 16 & 12 \\ 12 & 9 \end{bmatrix} \begin{bmatrix} 16/25 & 12/25 \\ 12/25 & 9/25 \end{bmatrix}.$$ For example, we can project the vector $u$ onto the line $L$ spanned by $w.$ The matrix $A$ defines this linear transformation $T$ and so to project onto the line $L$ is just matrix multiplication: $$T\begin{bmatrix}1\ 5\end{bmatrix}=\frac{1}{25} \begin{bmatrix} 16 & 12 \\ 12 & 9 \end{bmatrix} \begin{bmatrix}1\ 5\end{bmatrix} =\begin{bmatrix}76/25\ 57/25\end{bmatrix}.$$
as needed.

## Reflection Transformations

Theorem. Let $T$ be a linear transformation from $\mathbb{R}^2$ to $\mathbb{R}^2.$ If the matrix of $T$ is of the form $$\begin{bmatrix} 2 u_1^2-1 & 2 u_1 u_2 \\ 2 u_1 u_2 & 2 u_2^2 -1 \end{bmatrix}$$ then $T$ defines a reflection transformation about the line $L$, where $u = \begin{bmatrix} u_1 \\ u_2 \end{bmatrix}$ is any unit vector lying on $L.$

Proof. Suppose we want to reflect $x$ through the line $L$. Then
$$\label{ref1} \operatorname{ref}_L(x)=x^{||}-x^\perp$$ and $$\label{ref2} \operatorname{proj}_L(x)=x^{||}.$$ We obtain $$\label{ref3} \operatorname{ref}_L(x)=2 \operatorname{proj}_L(x)-x.$$ For simplicity assume $L$ is a any line that passes through the origin and let $u$ be a unit vector $u = \begin{bmatrix} u_1 \ u_2 \end{bmatrix}$ lying on $L.$ In the special case of a unit vector $u$ it follows that $\operatorname{proj}_L(x)=(u\cdot x)u.$ Then \begin{align*} \operatorname{ref}_L(x)& =2 \operatorname{proj}_L(x)-x =2(u\cdot x)u-x \\ & = 2(u_1x_1+u_2x_2)\begin{bmatrix} u_1 \\ u_2 \end{bmatrix}-\begin{bmatrix} x_1 \\ x_2 \end{bmatrix} \\ & =2u_1 x_1 \begin{bmatrix} u_1 \\ u_2 \end{bmatrix}+2u_2x_2 \begin{bmatrix} u_1 \\ u_2 \end{bmatrix}-\begin{bmatrix} x_1 \\ x_2 \end{bmatrix} \\ & = \begin{bmatrix} 2u_1^2x_1+2u_1 u_2x_2-x_1 \\ 2u_1u_2x_1+2u_2^2 u_2x_2-x_2 \end{bmatrix} \\& = \begin{bmatrix} 2u_1^2-1 & 2u_1 u_2\\ 2u_1 u_2 & 2u_2^2-1 \end{bmatrix} \begin{bmatrix}x_1\\ x_2\end{bmatrix}. \end{align*}

as needed.

Example. Find the matrix $A$ of a reflection through the line through the origin spanned by $w = \begin{bmatrix} 4 \\ 3 \end{bmatrix}$ and use it to reflect $\begin{bmatrix} 1 \\ 5 \end{bmatrix}$ about the line $L.$

Solution. Let $u=\begin{bmatrix}4/5 \\ 3/5\end{bmatrix}.$ We notice $u$ is a unit vector, since $\left|\left| u \right|\right| =1.$ Then the matrix we seek is $$A=\begin{bmatrix} 7/25 & 24/25 \\ 24/25 & -7/25 \end{bmatrix}.$$ We can reflect the vector $\begin{bmatrix} 1 \\ 5 \end{bmatrix}$ about the line $L$ using matrix multiplication $$T \begin{bmatrix} 1 \\ 5 \end{bmatrix} = \frac{1}{25} \begin{bmatrix} 7 & 24 \\ 24 & -7 \end{bmatrix} \begin{bmatrix} 1 \\ 5 \end{bmatrix} =\begin{bmatrix}127/25\\ -11/25\end{bmatrix}$$ as desired.

## Rotation Transformations

Theorem. Let $T$ be a linear transformation from $\mathbb{R}^2$ to $\mathbb{R}^2.$ If the matrix of $T$ is of the form $$\begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{bmatrix}$$ then $T$ is a (counterclockwise) rotation transformation through an angle $\theta.$

Proof. If a vector $x=\begin{bmatrix} x_1\\ x_2\end{bmatrix}$ is rotated through an angle of $\pi/2$, then a vector $y=\begin{bmatrix} -x_2\\ x_1\end{bmatrix}$ is obtained, via $x\cdot y =0.$ More generally, if we rotate (counterclockwise) a given $x$ through an angle $\theta$ we determine

\begin{align} T(x) & =(\cos \theta) x+(\sin\theta) y =(\cos \theta)\begin{bmatrix}x_1\\ x_2\end{bmatrix} + (\sin \theta)\begin{bmatrix} -x_2\\ x_1\end{bmatrix} \\ &=\begin{bmatrix}(\cos \theta)x_1-(\sin\theta))x_2 \ (\sin \theta)x_1-(\cos\theta))x_2\end{bmatrix} \\ & =\begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{bmatrix} \begin{bmatrix} x_1 \\ x_2\end{bmatrix} =\begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{bmatrix} x \end{align}

Example. Find the matrix of the linear transformation that rotates the vector $\begin{bmatrix} 4 \\ 2 \end{bmatrix}$ by 30 degrees counterclockwise. By \cref{rotmatrix}, the matrix of this transformation is $$A= \begin{bmatrix} \sqrt{3}/2 & -1/2 \\ 1/2 & \sqrt{3}/2 \end{bmatrix} .$$ We will use matrix multiplication to perform the transformation

\begin{align} T\begin{bmatrix}4\ 2\end{bmatrix} & = \begin{bmatrix} \frac{\sqrt{3}}{2} & \frac{-1}{2} \\ \frac{1}{2} & \frac{\sqrt{3}}{2} \end{bmatrix} \begin{bmatrix} 4\\ 2\end{bmatrix} =\cos 30^\circ \begin{bmatrix}4\\ 2\end{bmatrix}+\sin 30^\circ \begin{bmatrix}4\\ 2\end{bmatrix} \\ & =\begin{bmatrix}2\left(\sqrt{3}+1\right)\\ \sqrt{3}+1\end{bmatrix}.\end{align}

## Transformation Matrices: Vertical and Horizontal Shears

Theorem. Let $T$ be a linear transformation from $\mathbb{R}^2$ to $\mathbb{R}^2.$ If the matrix of $T$ is of the form $$\begin{bmatrix} 1 & 0 \\ k & 1 \end{bmatrix} \qquad \text{or} \qquad \begin{bmatrix} 1 & k \\ 0 & 1 \end{bmatrix},$$ where $k$ is any constant, then $T$ defines a vertical shear or horizontal shear transformation, respectively.

Example. Given the vector $\begin{bmatrix} 2 \\ 3 \end{bmatrix}$ in $\mathbb{R}^2$ show geometrically a vertical shear of 2 and a horizontal shear of $\frac{1}{2}.$

Solution. We can apply these linear transformations using matrix multiplication by using the matrices $\begin{bmatrix} 1 & 0 \\ 2 & 1 \end{bmatrix}$ and $\begin{bmatrix} 1 & 1/2 \\ 0 & 1 \end{bmatrix}.$ $$\text{Vertical Shear:} \qquad T\begin{bmatrix} 2 \\ 3 \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 2 & 1 \end{bmatrix} \begin{bmatrix} 2 \\ 3 \end{bmatrix} = \begin{bmatrix} 2 \\ 7 \end{bmatrix}$$ $$\text{Horizontal Shear:} \qquad T\begin{bmatrix} 2 \\ 3 \end{bmatrix} = \begin{bmatrix} 1 & 1/2 \\ 0 & 1 \end{bmatrix} \begin{bmatrix} 2 \\ 3 \end{bmatrix} =\begin{bmatrix} 7/2 \\ 3 \end{bmatrix}$$

## Combining Transformations Together

Example. Interpret the linear transformation $$T(x)= \begin{bmatrix} 0 & -1 \\ -1 & 0 \end{bmatrix} x$$ geometrically.

Solution. The transformation has a matrix of the form $$\begin{bmatrix} 2u_1^2-1 & 2 u_1 u_2 \\ 2u_1 u_2 & 2u_2^2-1 \end{bmatrix}$$ where $u_1=\sqrt{2}/2$ and $u_2=-\sqrt{2}/2$ since $2u_1^2-1=0$, $2u_2^2-1=0$, and $2u_1 u_2=-1.$ Since $|| u ||=1$ and $u$ lies on the line $y=x$, then matrix $$\begin{bmatrix} 0 & -1 \\ -1 & 0 \end{bmatrix}$$ represents the linear transformation which is a reflection through the line $y=x.$

Example. Interpret the linear transformation $$T(x)= \begin{bmatrix} 1& 1 \\ -1 & 1 \end{bmatrix} x$$ geometrically.

Solution. This is a rotation combined with a scaling. The transformation rotates 45 degrees counterclockwise and has a scaling factor of $\sqrt{2}.$

David Smith (Dave) has a B.S. and M.S. in Mathematics and has enjoyed teaching precalculus, calculus, linear algebra, and number theory at both the junior college and university levels for over 20 years. David is the founder and CEO of Dave4Math.