Three Basic Ways to Transform the Plane
A two-dimensional matrix transformation takes an input point with coordinates \((x,y)\) and produces an output point. We represent the point by the column vector \(\begin{bmatrix}x\\y\end{bmatrix}\); multiplying by a \(2\times2\) matrix gives the output coordinates. Rotations, coordinate scalings, and shears are useful models because each changes a point in a different, structured way. By applying a matrix to a few points—especially the corners of a square—we can interpret the transformation geometrically.
In this tutorial the scalars and coordinates are real. Each transformation is centered at the origin, so its matrix fixes \(\mathbf{0}\). The matrices describe the linear part of a transformation; a shift of the whole plane would require an additional translation, which is not part of these three models.
For a column \(\mathbf{x}=\begin{bmatrix}x\\y\end{bmatrix}\), multiplication gives \(\mathbf{R}(\theta)\mathbf{x}=\begin{bmatrix}x\cos\theta-y\sin\theta\\x\sin\theta+y\cos\theta\end{bmatrix}\), \(\mathbf{D}(a,b)\mathbf{x}=\begin{bmatrix}ax\\by\end{bmatrix}\), and \(\mathbf{H}(k)\mathbf{x}=\begin{bmatrix}x+ky\\y\end{bmatrix}\). In particular, a horizontal shear leaves the \(y\)-coordinate unchanged and shifts the \(x\)-coordinate by an amount depending on \(y\). A vertical shear, if desired, is represented by \(\begin{bmatrix}1&0\\k&1\end{bmatrix}\): it leaves \(x\) unchanged and adds \(kx\) to \(y\).
Rotations Preserve Lengths and Angles
The signs in the rotation matrix fix the direction convention: a positive angle rotates counterclockwise. For instance, a quarter-turn sends the positive \(x\)-axis toward the positive \(y\)-axis. More generally, a rotation changes the coordinates but does not stretch or compress the plane.
Proof. Write \(c=\cos\theta\) and \(s=\sin\theta\). Direct multiplication gives
where \(c^2+s^2=1\). Therefore, using the definition of the dot product and matrix multiplication, \((\mathbf{R}(\theta)\mathbf{u})\cdot(\mathbf{R}(\theta)\mathbf{v})=\mathbf{u}^{\top}\mathbf{R}(\theta)^{\top}\mathbf{R}(\theta)\mathbf{v}=\mathbf{u}^{\top}\mathbf{I}_2\mathbf{v}=\mathbf{u}\cdot\mathbf{v}\). Taking \(\mathbf{u}=\mathbf{v}\) shows that the squared length is unchanged, so the length is unchanged. For nonzero \(\mathbf{u},\mathbf{v}\), the cosine of the angle between them is their dot product divided by the product of their lengths. Since both the dot product and lengths are preserved, that cosine—and therefore the angle in \([0,\pi]\)—is preserved as well. \(\square\)
Worked Example: A Quarter-Turn
Rotate the point with position vector \(\mathbf{x}=\begin{bmatrix}2\\1\end{bmatrix}\) counterclockwise by \(90^\circ\). Since \(\cos 90^\circ=0\) and \(\sin 90^\circ=1\), the matrix is
The point moves to \((-1,2)\). To check the calculation, its original squared length is \(2^2+1^2=5\), while the output squared length is \((-1)^2+2^2=5\). Multiplying the displayed matrix by the output also gives \(\begin{bmatrix}0&-1\\1&0\end{bmatrix}\begin{bmatrix}-1\\2\end{bmatrix}=\begin{bmatrix}-2\\-1\end{bmatrix}\), the original vector rotated by another \(90^\circ\), as expected for a second quarter-turn.
Coordinate Scaling: Stretching, Shrinking, and Flipping
The matrix \(\mathbf{D}(a,b)\) acts separately on the two coordinate directions: the \(x\)-coordinate is multiplied by \(a\), and the \(y\)-coordinate by \(b\). A negative factor reverses the corresponding coordinate direction. Lengths along those axes are multiplied by \(|a|\) and \(|b|\), not by the signed factors themselves.
Proof. The transformed vector is \(\begin{bmatrix}ax\\by\end{bmatrix}\), whose squared length is \((ax)^2+(by)^2=a^2x^2+b^2y^2\). If \(|a|=|b|=r\), this squared length is \(r^2(x^2+y^2)\), so every length is multiplied by \(r\), including when \(r=0\). Conversely, suppose every vector length is multiplied by the same factor \(r\). Applying the transformation to \(\mathbf{e}_1=\begin{bmatrix}1\\0\end{bmatrix}\) shows that \(r=|a|\); applying it to \(\mathbf{e}_2=\begin{bmatrix}0\\1\end{bmatrix}\) shows that \(r=|b|\). Hence \(|a|=|b|\). \(\square\)
The zero-factor cases have different images. If \(a=0\) and \(b\ne0\), every output has \(x\)-coordinate zero, and as the input \(y\) varies the image is the \(y\)-axis. If \(b=0\) and \(a\ne0\), the image is the \(x\)-axis. If both factors are zero, every point maps to \(\mathbf{0}\), so the image is a single point.
Worked Example: Scaling the Unit Square
Apply \(\mathbf{D}(2,-\tfrac12)\) to the unit square with corners \((0,0),(1,0),(1,1),(0,1)\). The matrix-vector products for its corners are
Thus the square becomes a rectangle of width \(2\) and height \(\tfrac12\), below the \(x\)-axis rather than above it. The horizontal side length has been multiplied by \(|2|=2\); the vertical side length has been multiplied by \(|-\tfrac12|=\tfrac12\), and the negative factor flips the vertical direction. As a check, the four displayed outputs are exactly the results of replacing each input \((x,y)\) by \((2x,-\tfrac12y)\).
Shear: Sliding Along Parallel Lines
A horizontal shear sends \((x,y)\) to \((x+ky,y)\). Points on the \(x\)-axis have \(y=0\), so they stay fixed. Every horizontal line \(y=c\) is shifted horizontally by the same amount \(kc\), while its points retain their \(y\)-coordinate. A square therefore generally becomes a parallelogram: horizontal edges remain horizontal, while the other edges may tilt.
Proof. For an arbitrary point \(\begin{bmatrix}x\\y\end{bmatrix}\), the first shear gives \(\begin{bmatrix}x+ky\\y\end{bmatrix}\). Applying \(\mathbf{H}(-k)\) to this output gives \(\begin{bmatrix}(x+ky)-ky\\y\end{bmatrix}=\begin{bmatrix}x\\y\end{bmatrix}\). Reversing the order gives the same result, since \(\mathbf{H}(-k)\mathbf{H}(k)=\mathbf{H}(k)\mathbf{H}(-k)=\begin{bmatrix}1&0\\0&1\end{bmatrix}\). Thus every input can be recovered, and two distinct inputs cannot have the same output: applying the inverse to equal outputs would make their inputs equal. \(\square\)
Worked Example: Shearing a Unit Square
Use a horizontal shear with \(k=2\) on the unit square. For each corner, compute \((x+2y,y)\):
The image has corners \((0,0),(1,0),(3,1),(2,1)\). Its bottom and top edges are horizontal; its other two edges are parallel slanted segments. To check, the matrix product \(\begin{bmatrix}1&2\\0&1\end{bmatrix}\begin{bmatrix}1\\1\end{bmatrix}=\begin{bmatrix}3\\1\end{bmatrix}\) agrees with the coordinate rule. Applying the inverse shear to that output gives \(\begin{bmatrix}1&-2\\0&1\end{bmatrix}\begin{bmatrix}3\\1\end{bmatrix}=\begin{bmatrix}1\\1\end{bmatrix}\), recovering the original corner.
Combining Transformations
For successive linear transformations, the matrix for the later action multiplies on the left. Thus, applying a scaling first and a shear second gives the product \(\mathbf{H}(k)\mathbf{D}(a,b)\). This order matters: matrix multiplication is generally not commutative, so reversing the factors may describe a different transformation.
Worked Example: Scale, Then Shear
First stretch the \(x\)-coordinate by \(2\), using \(\mathbf{D}(2,1)\), then apply the horizontal shear \(\mathbf{H}(2)\). The combined matrix is
For the input \(\begin{bmatrix}1\\1\end{bmatrix}\), the two steps give \(\mathbf{D}(2,1)\begin{bmatrix}1\\1\end{bmatrix}=\begin{bmatrix}2\\1\end{bmatrix}\), followed by \(\mathbf{H}(2)\begin{bmatrix}2\\1\end{bmatrix}=\begin{bmatrix}4\\1\end{bmatrix}\). The product matrix gives the same answer: \(\begin{bmatrix}2&2\\0&1\end{bmatrix}\begin{bmatrix}1\\1\end{bmatrix}=\begin{bmatrix}4\\1\end{bmatrix}\). This checks both the matrix multiplication and the stated order.
Common Pitfalls
Using signed factors to describe lengths. A tempting claim is that \(a\ne b\) means the two coordinate directions change lengths by different amounts. For \(a=1,b=-1\), that claim would predict different length changes, but \(|a|=|b|=1\): neither axis length changes. The transformation flips the \(y\)-direction while preserving all lengths. The correct comparison is between \(|a|\) and \(|b|\), not between \(a\) and \(b\). In particular, if \(a=b\), all lengths are multiplied by \(|a|\), not by the possibly negative number \(a\).
Misidentifying the image when a factor is zero. If \(a=b=0\), the formula \((x,y)\mapsto(ax,by)\) gives \((0,0)\) for every input. The image is the origin alone, not an axis. Exactly one zero factor collapses the plane onto the other coordinate axis; two zero factors collapse it to one point.
Mixing up the order of a composition. In the combined example, reversing the matrices would give \(\mathbf{D}(2,1)\mathbf{H}(2)=\begin{bmatrix}2&4\\0&1\end{bmatrix}\), which sends \(\begin{bmatrix}1\\1\end{bmatrix}\) to \(\begin{bmatrix}6\\1\end{bmatrix}\), not \(\begin{bmatrix}4\\1\end{bmatrix}\). A reliable check is to apply each transformation to a test vector in the stated order and compare with the product.
Check Your Understanding
Use matrix multiplication and coordinate descriptions to answer these questions.
- Write the matrix for a clockwise rotation by \(90^\circ\), and apply it to \(\begin{bmatrix}1\\3\end{bmatrix}\).
- Under \(\mathbf{D}(-3,\tfrac12)\), by what factors do lengths along the two coordinate axes change? Which direction is flipped?
- Describe the image of the plane under \(\mathbf{D}(0,-2)\). What is the image under \(\mathbf{D}(0,0)\)?
- For \(\mathbf{H}(-1)\), find the image of each corner of the unit square and describe the resulting shape.
- Apply \(\mathbf{H}(1)\) first and then \(\mathbf{D}(2,1)\). Find the combined matrix and its output on \(\begin{bmatrix}1\\1\end{bmatrix}\).