Geometry of linear transformations

Published

September 10, 2025

In this set of class notes, we’re going to take a look at some ways to visualize linear transformations to, hopefully, generate some intuition about how they operate.

Why not graphs??

I guess the most basic way to visualize a function is via a graph. We’re certainly all familiar with the graph of \(f(x)=x^2\):

Note that this function, like most of the functions that you study in calculus, maps \(\mathbb R \to \mathbb R\). We say that the point \((x,y)\) is on the graph of \(y=f(x)\). Thus, the graph lives in \(\mathbb R^2\).

Graphs of bivariate functions

In Calc III you study functions mapping \(\mathbb R^2 \to \mathbb R\), which are called bivariate. Thus, \((x,y,z)\) is on the graph if \(z=f(x,y)\) so that the graph lives in three dimensional space:

More generally, if \(f:\mathbb R^n \to \mathbb R^m\), then its graph consists of those points \((\mathbf{x}, \mathbf{y})\) such that \(\mathbf x \in \mathbb R^n\) and \(\mathbf y \in \mathbb R^m\). Thus, the graph lives in \((m+n)\)-dimensional space. If both are at least two, we have a problem!

Lineland

In search of an alternative, let’s suppose we live in one-dimensional space (called lineland in Edwin Abbott’s classic flatland) and wish to visualize a function \(f:\mathbb R \to \mathbb R\). One way to do so might be to illustrate the effect of \(f\) by viewing before and after images of natural sets in the line. We might even do so via an animation, like so:

Back here in our universe, we might realize that what we are effectively doing is examining the image of the set on the \(x\)-axis after it’s been mapped to the \(y\)-axis.

2D Linear transformations

If we’d like to understand how linear transformation affect space geometrically, we can take an approach that’s similar to Lineland’s approach to univariate functions. For visualization purposes, the dimension of both the domain and range cannot exceed three so I suppose the natural place to start is with functions mapping \(\mathbb R^2 \to \mathbb R^2\). In this section, we’ll examine the effect of several matrices on the unit square and, by extension, on the whole plane.

Stretch and squish

The unit square is shown below. To see the effect of the matrix \[\begin{bmatrix}2&0\\0&1/2\end{bmatrix}\] on that square, just check the “Apply” box.

I think that this makes all kinds of sense. Note that the columns become sides of the new square and everything else in the square sorta follows along.

Reflect

If we have a diagonal matrix with one negative entry, then that entry induces a reflection. \[\begin{bmatrix}-1&0\\0&1\end{bmatrix}\]

Reflect diagonally

Swapping two rows in the identity matrix also induces a reflection but along a different axis. \[\begin{bmatrix}0&1\\1&0\end{bmatrix}\]

Skew

Another operation is a skew, which can be generated by adding two rows in the identity matrix. \[\begin{bmatrix}1&1\\0&1\end{bmatrix}\]

To understand the result, recall that every time we apply matrix multiplication to our image of the unit circle, the legs of the image are exactly the columns of the matrix.

Project

If we set one entry of a diagonal matrix to zero, we obtain a projection. \[\begin{bmatrix}1&0\\0&0\end{bmatrix}\]

Rotate

The result here looks like rotation through the angle \(90^{\circ}\). \[\begin{bmatrix}0&-1\\1&0\end{bmatrix}\]

Stretch and rotate

If the vectors \[\begin{bmatrix}1\\0\end{bmatrix} \text{ and } \begin{bmatrix}0\\1\end{bmatrix}\] map to longer vectors that also meet at a \(90^{\circ}\) angle, the result must both rotate and stretch. \[\begin{bmatrix}1&-1\\1&1\end{bmatrix}\]

Eigenstuff??

Here’s another look at the matrix illustrated on our front page. We’ll get a better grip on this after we talk about the concepts of eigenvalues and their associated eigenvectors. \[\begin{bmatrix}1&1\\1/2&3/2\end{bmatrix}\]

More complicated examples

Understanding rotation

We saw a couple of examples of rotation above and it’s worth asking if we can understand that more generally. In particular, can we rotate about the origin through an arbitrary angle?

To do so, let \(\theta\) denote the angle through which we wish to rotate and define the matrix \(R\) as a function of \(\theta\) by \[R(\theta) = \begin{bmatrix}\cos(\theta)&-\sin(\theta)\\\sin(\theta)&\cos(\theta)\end{bmatrix}.\]

Here’s the effect of that matrix as a function of the angle \(\theta\):

It’s not too hard to see why this should work. Recall that the image of the vector \([1 \: 0]^T\) is exactly the first column of the matrix. That is, \[ \begin{bmatrix}1\\0\end{bmatrix} \rightarrow \begin{bmatrix}\cos(\theta)\\\sin(\theta)\end{bmatrix}. \] That image, though, is exactly the rotation of \([1 \: 0]^T\) through the angle \(\theta\) by the very definition of the trig functions.

Similarly, \[ \begin{bmatrix}0\\1\end{bmatrix} \rightarrow \begin{bmatrix}-\sin(\theta)\\\cos(\theta)\end{bmatrix} \] and, again, the image of the vector is exactly the original vector rotated through the angle \(\theta\).

Now, as we know, the two vectors \([1 \: 0]^T\) and \([0 \: 1]^T\) span \(\mathbb R^2\). That is, any vector \(\mathbf{u}\) can be written as a linear combination \[ \mathbf{u} = \alpha \begin{bmatrix}1\\0\end{bmatrix} + \beta \begin{bmatrix}0\\1\end{bmatrix}. \] Furthermore, by linear of matrix multiplication, we have \[\begin{aligned} R(\theta)\mathbf{u} &= R(\theta)\left(\alpha \begin{bmatrix}1\\0\end{bmatrix} + \beta \begin{bmatrix}0\\1\end{bmatrix}\right) \\ &= \alpha \, R(\theta) \begin{bmatrix}1\\0\end{bmatrix} + \beta \, R(\theta) \begin{bmatrix}0\\1\end{bmatrix} \end{aligned}.\]

Thus, since multiplication by \(R(\theta)\) rotates \([1 \: 0]^T\) and \([0 \: 1]^T\) through the angle \(\theta\), the vector \(\mathbf{u}\) will follow along and will also rotate through the angle \(\theta\).

Oblique reflection

These simple transformations can be combined to powerful effect. Let’s suppose, for example, that we’d like a linear transformation that reflects across a line through the origin. That’s easy if the line is the \(x\) or \(y\) axis. It’s trickier, though, if it’s some other line making an angle \(\theta\) with the \(x\)-axis, like so:

One way to accomplish this reflection is to first rotate the image clockwise through the angle \(\theta\), reflect across the \(x\)-axis, and then rotate back. You can hit the step button a few times to step through this process.

Each of those operations is described by matrix multiplication and the composition of all three yields the reflection. Thus, we can find a single matrix \(M\) that represents the reflection by matrix multiplication. \[ M = \begin{bmatrix} \cos(\theta) & -\sin(\theta) \\ \sin(\theta) & \cos(\theta) \end{bmatrix} \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix} \begin{bmatrix} \cos(\theta) & \sin(\theta) \\ -\sin(\theta) & \cos(\theta) \end{bmatrix} \tag{1}\]

If, for example, we want to rotate across the line \(y=\frac{1}{2}x\), then the angle is \(\theta = \arctan(1/2)\) and the matrix works out to be \[ M = \begin{bmatrix}3/5 & 4/5 \\ 4/5 & -3/5\end{bmatrix}. \] I suppose that might be a bit of a pain to actually compute but here’s a little SageMath code that might persuade you.

Better yet, here it is in action:

Oblique projection

Of course, we can do something quite similar for oblique projection. All we have to do is change the reflection matrix to a projection matrix. Thus, in Equation 1, we replace \[ \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix} \text{ with } \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix}. \]

If we want to project onto the line \(y=\frac{1}{2}x\), this yields the matrix \[ \begin{bmatrix} 4/5 & 2/5 \\ 2/5 & 1/5 \end{bmatrix}. \]

You could probably edit the SageMath code from the oblique projection example to convince yourself of that and here it is in action: