Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

3.4: Examples of linear transformations

Chapter 3.3 introduced the definition of a linear transformation, TT. Here, we will discuss several examples of linear transformations, and learn how to find and use a linear transformation’s associated matrix.


A first example

Consider

A=[1110].A=\begin{bmatrix}1&1\\1&0\end{bmatrix}.

It’s not immediately obvious what multiplying by AA will do. Let’s try a few inputs:

A[10]=[11],A[01]=[10],A[11]=[21].A\begin{bmatrix}1\\0\end{bmatrix}=\begin{bmatrix}1\\1\end{bmatrix},\qquad A\begin{bmatrix}0\\1\end{bmatrix}=\begin{bmatrix}1\\0\end{bmatrix},\qquad A\begin{bmatrix}1\\1\end{bmatrix}=\begin{bmatrix}2\\1\end{bmatrix}.

The first two outputs are the columns of AA. The third is the sum of the two columns of AA – this should not be a surprise, since the act of multiplying by AA is a linear transformation, and so it must be true that

T(u⃗+v⃗)=T(u⃗)+T(v⃗)T(\vec u + \vec v) = T(\vec u) + T(\vec v)

for all possible u⃗\vec u and v⃗\vec v. (Here, u⃗\vec u is the first column of AA and v⃗\vec v is the second column of AA.)

Let e⃗1=[10]\color{#3d81f6}{\vec e_1}=\begin{bmatrix}1\\0\end{bmatrix} and e⃗2=[01]\color{orange}{\vec e_2}=\begin{bmatrix}0\\1\end{bmatrix} be the standard basis vectors. To see more than individual vectors, let’s draw the square with corners 0⃗\vec0, e⃗1\vec e_1, e⃗1+e⃗2\vec e_1+\vec e_2, and e⃗2\vec e_2, and apply AA to every point in it. This is a visualization strategy we will use repeatedly in this section.

Loading...

The square becomes a parallelogram! As we will see later in this section, this transformation is an example of a shear. As a function, this is the transformation

T([xy])=[x+yx].T \left( \begin{bmatrix}x\\y\end{bmatrix} \right) =\begin{bmatrix}x+y\\x\end{bmatrix}.

For instance, [2−1]\begin{bmatrix}2\\-1\end{bmatrix} becomes [12]\begin{bmatrix}1\\2\end{bmatrix}.

For the next several examples, we focus on transformations from R2\mathbb R^2 to R2\mathbb R^2 – which are defined using a 2×22 \times 2 matrix – because transformations in which the input and output vectors are both in R2\mathbb{R}^2 are easy to visualize. Later, we will consider transformations whose domains and codomains have different shapes.


Stretching

Suppose we want to stretch everything horizontally by a factor of 2, leaving the vertical coordinates alone. What should happen to [xy]\begin{bmatrix}x\\y\end{bmatrix}? It should become

T([xy])=[2xy].T \left( \begin{bmatrix} x \\ y \end{bmatrix} \right) = \begin{bmatrix}2x\\y\end{bmatrix}.

Its associated matrix – that is, the matrix HH for which T([xy])=H[xy]T \left( \begin{bmatrix} x \\ y \end{bmatrix} \right) = H \begin{bmatrix} x \\ y \end{bmatrix} – is

H=[2001].H=\begin{bmatrix}2&0\\0&1\end{bmatrix}.

We could also find HH by following the standard basis vectors. Recall that the standard basis vectors in R2\mathbb R^2 are

e⃗1=[10],e⃗2=[01].\vec e_1=\begin{bmatrix}1\\0\end{bmatrix},\qquad \vec e_2=\begin{bmatrix}0\\1\end{bmatrix}.

At the end of Chapter 3.3, we said that if we know the outputs of a linear transformation for e⃗1\vec e_1 and e⃗2\vec e_2 — that is, T(e⃗1)T(\vec e_1) and T(e⃗2)T(\vec e_2) — we know its entire associated matrix:

H=[∣∣T(e⃗1)T(e⃗2)∣∣].H=\begin{bmatrix}|&|\\T(\vec e_1)&T(\vec e_2)\\|&|\end{bmatrix}.

Here, the first basis vector doubles in length, while the second stays where it is:

T(e⃗1)=T([10])=[20],T(e⃗2)=T([01])=[01].T(\vec e_1)=T\left(\begin{bmatrix}1\\0\end{bmatrix}\right)=\begin{bmatrix}2\\0\end{bmatrix},\qquad T(\vec e_2)=T\left(\begin{bmatrix}0\\1\end{bmatrix}\right)=\begin{bmatrix}0\\1\end{bmatrix}.

Putting these outputs into columns gives H=[2001]H=\begin{bmatrix}2&0\\0&1\end{bmatrix}, as before.

Loading...

More generally, a diagonal matrix [a00b]\begin{bmatrix}a&0\\0&b\end{bmatrix} multiplies the first coordinate by aa and the second by bb. When a=b=2a=b=2, both coordinates double, so the whole square doubles in size. When a scale factor is negative, there is a flip as well, which we can interpret as a reflection across an axis – as we’re about to do.


Reflection

To reflect across the xx-axis, keep the first coordinate and change the sign of the second:

T([xy])=[x−y].T \left( \begin{bmatrix} x \\ y \end{bmatrix} \right) = \begin{bmatrix} x \\ -y \end{bmatrix}.

This is slightly counterintuitive, perhaps: reflecting across the xx-axis changes the vector’s yy component, not its xx component.

This transformation has associated matrix

S=[100−1].S=\begin{bmatrix}1&0\\0&-1\end{bmatrix}.

For example, [21]\begin{bmatrix}2\\1\end{bmatrix} becomes [2−1]\begin{bmatrix}2\\-1\end{bmatrix}. A point above the xx-axis moves the same distance below it. Points already on the xx-axis stay put.

Loading...

What would change if we reflected across the yy-axis instead? Now we would change the sign of the first coordinate, giving [−1001]\begin{bmatrix}-1&0\\0&1\end{bmatrix}.

We’ve shown the two simplest examples of reflections – across the xx or yy axes. In a homework problem, you’ll explore how to reflect across a line that has some slope, e.g. across the line spanned by [3−5]\begin{bmatrix} 3 \\ -5 \end{bmatrix}.


Rotation

What matrix rotates vectors counterclockwise by 90∘90^\circ about the origin? Rather than guessing all four entries, let’s follow the standard basis vectors:

[10]⏟e⃗1⟼[01],[01]⏟e⃗2⟼[−10].\underbrace{\begin{bmatrix}1\\0\end{bmatrix}}_{\vec e_1}\longmapsto\begin{bmatrix}0\\1\end{bmatrix},\qquad \underbrace{\begin{bmatrix}0\\1\end{bmatrix}}_{\vec e_2}\longmapsto\begin{bmatrix}-1\\0\end{bmatrix}.

These are the columns of the transformation’s associated matrix! Therefore,

R=[0−110],T([xy])=[−yx].R=\begin{bmatrix}0&-1\\1&0\end{bmatrix},\qquad T\left(\begin{bmatrix}x\\y\end{bmatrix}\right)=\begin{bmatrix}-y\\x\end{bmatrix}.

For example, R[21]=[−12]R\begin{bmatrix}2\\1\end{bmatrix}=\begin{bmatrix}-1\\2\end{bmatrix}.

Loading...

The same idea works for any fixed angle θ\theta. A counterclockwise rotation sends

e⃗1⟼[cos⁡θsin⁡θ],e⃗2⟼[−sin⁡θcos⁡θ].\vec e_1\longmapsto\begin{bmatrix}\cos\theta\\\sin\theta\end{bmatrix},\qquad \vec e_2\longmapsto\begin{bmatrix}-\sin\theta\\\cos\theta\end{bmatrix}.

The first vector, T(e⃗1)T(\vec e_1), comes from the unit circle: trigonometry tells us that the point at distance 1 from (0,0)(0,0) that makes an angle θ\theta with the xx-axis is (cos⁡θ,sin⁡θ)(\cos\theta,\sin\theta). The second vector, T(e⃗2)T(\vec e_2), is a 90∘90^\circ counterclockwise rotation from the first. Thus

T([xy])=Rθ[xy],T\left(\begin{bmatrix}x\\y\end{bmatrix}\right)=R_\theta\begin{bmatrix}x\\y\end{bmatrix},

where the associated matrix is

Rθ=[cos⁡θ−sin⁡θsin⁡θcos⁡θ].R_\theta=\begin{bmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{bmatrix}.

Use the slider below to change θ\theta.

Loading...

Rotations preserve lengths and angles between vectors:

  • Preserving length means that ∥Rθx⃗∥=∥x⃗∥\lVert R_\theta \vec x \rVert = \lVert \vec x \rVert for all x⃗\vec x. This is not true of every linear transformation: a transformation that stretches the xx-component by 2 and keeps the yy-component fixed doubles the length of e⃗1\vec e_1 but leaves the length of e⃗2\vec e_2 unchanged.

  • Preserving angles means that the angle between u⃗\vec u and v⃗\vec v is the same as the angle between Rθu⃗R_\theta \vec u and Rθv⃗R_\theta \vec v. Again, this is also not true in general of all linear transformations.

You might notice that the columns of RθR_\theta form an orthonormal basis for R2\mathbb R^2. Their dot product is

[cos⁡θsin⁡θ]⋅[−sin⁡θcos⁡θ]=(cos⁡θ)(−sin⁡θ)+(sin⁡θ)(cos⁡θ)=0,\begin{bmatrix}\cos\theta\\\sin\theta\end{bmatrix}\cdot\begin{bmatrix}-\sin\theta\\\cos\theta\end{bmatrix} =(\cos\theta)(-\sin\theta)+(\sin\theta)(\cos\theta)=0,

and their lengths are

∥[cos⁡θsin⁡θ]∥=cos⁡2θ+sin⁡2θ=1,∥[−sin⁡θcos⁡θ]∥=sin⁡2θ+cos⁡2θ=1.\left\lVert\begin{bmatrix}\cos\theta\\\sin\theta\end{bmatrix}\right\rVert =\sqrt{\cos^2\theta+\sin^2\theta}=1,\qquad \left\lVert\begin{bmatrix}-\sin\theta\\\cos\theta\end{bmatrix}\right\rVert =\sqrt{\sin^2\theta+\cos^2\theta}=1.

It turns out that any 2×22\times2 matrix whose columns form an orthonormal basis for R2\mathbb R^2 represents a rotation, possibly combined with a reflection.

For example, consider

Q=[3/54/5−4/53/5].Q=\begin{bmatrix}3/5&4/5\\-4/5&3/5\end{bmatrix}.

Its columns have dot product (35)(45)+(−45)(35)=0\left(\frac35\right)\left(\frac45\right)+\left(-\frac45\right)\left(\frac35\right)=0, and each has length (3/5)2+(4/5)2=1\sqrt{(3/5)^2+(4/5)^2}=1. This matrix is a rotation with cos⁡θ=3/5\cos\theta=3/5 and sin⁡θ=−4/5\sin\theta=-4/5: it rotates vectors clockwise by approximately 53.1∘53.1^\circ. Here is what it does to the unit square and standard basis vectors.

Loading...

Shear

In this next transformation, imagine glueing one edge of the unit square to the xx-axis, and dragging the top-right corner of it to the right or left. Such a transformation may be of the form:

T([xy])=[x+yy].T\left(\begin{bmatrix}x\\y\end{bmatrix}\right)=\begin{bmatrix}x+y\\y\end{bmatrix}.

Its associated matrix is

K=[1101].K=\begin{bmatrix}1&1\\0&1\end{bmatrix}.

This is called a horizontal shear.

Loading...

For example, [21]\begin{bmatrix}2\\1\end{bmatrix} becomes [31]\begin{bmatrix}3\\1\end{bmatrix}, while [20]\begin{bmatrix}2\\0\end{bmatrix} stays unchanged. This isn’t moving everything the same distance to the right: how far a point moves depends on its second coordinate.

A stronger horizontal shear is

T([xy])=[x+3yy],T\left(\begin{bmatrix}x\\y\end{bmatrix}\right)=\begin{bmatrix}x+3y\\y\end{bmatrix},

with associated matrix [1301]\begin{bmatrix}1&3\\0&1\end{bmatrix}. More generally, replacing the upper-right entry by kk gives the horizontal shear T([xy])=[x+kyy]T\left(\begin{bmatrix}x\\y\end{bmatrix}\right)=\begin{bmatrix}x+ky\\y\end{bmatrix}.

Loading...

A vertical shear instead adds a multiple of the horizontal coordinate to the vertical coordinate. For example,

T([xy])=[x2x+y],T\left(\begin{bmatrix}x\\y\end{bmatrix}\right)=\begin{bmatrix}x\\2x+y\end{bmatrix},

whose associated matrix is [1021]\begin{bmatrix}1&0\\2&1\end{bmatrix}.

Loading...

Projection

Let’s return to an operation we already know: orthogonal projection. Let’s start with the simplest case, projecting onto the xx-axis. We keep the horizontal coordinate and set the vertical coordinate to zero:

T([xy])=[x0].T\left(\begin{bmatrix}x\\y\end{bmatrix}\right)=\begin{bmatrix}x\\0\end{bmatrix}.

Its associated matrix is

P=[1000].P=\begin{bmatrix}1&0\\0&0\end{bmatrix}.

What happens to our square this time?

Loading...

In all previous examples, the unit square on the left got transformed into a parallelogram on the right. Not here: the transformation sent both e⃗1=[10]\vec e_1=\begin{bmatrix}1\\0\end{bmatrix} and e⃗2=[01]\vec e_2=\begin{bmatrix}0\\1\end{bmatrix} to vectors that live on the xx-axis ([10]\begin{bmatrix}1\\0\end{bmatrix} and [00]\begin{bmatrix}0\\0\end{bmatrix}, respectively), so there is no longer a parallelogram — just a line segment.

Different inputs can have the same output: [12]\begin{bmatrix}1\\2\end{bmatrix} and [15]\begin{bmatrix}1\\5\end{bmatrix} both become [10]\begin{bmatrix}1\\0\end{bmatrix}.

We defined P:R2→R2P:\mathbb R^2\to\mathbb R^2, so its codomain is R2\mathbb R^2. But the outputs it actually produces all lie on the xx-axis – that is, its set of actual outputs is different than its set of possible outputs. There is no way for, say, [34]\begin{bmatrix}3\\4\end{bmatrix} to be the result of Px⃗P\vec x for any vector x⃗∈R2\vec x\in\mathbb R^2.

A slanted line

What if we project onto the line y=xy=x instead? Its unit direction vector is w⃗=12[11]\vec w=\frac1{\sqrt2}\begin{bmatrix}1\\1\end{bmatrix}. Using the projection formula from Chapter 2,

T([xy])=proj⁡w⃗[xy]=([xy]⋅w⃗)w⃗=[(x+y)/2(x+y)/2].T\left(\begin{bmatrix}x\\y\end{bmatrix}\right)=\operatorname{proj}_{\vec w}\begin{bmatrix}x\\y\end{bmatrix} =\left(\begin{bmatrix}x\\y\end{bmatrix}\cdot\vec w\right)\vec w =\begin{bmatrix}(x+y)/2\\(x+y)/2\end{bmatrix}.

Both output entries are the average of the two input entries, so the associated matrix is

P=[1/21/21/21/2].P=\begin{bmatrix}1/2&1/2\\1/2&1/2\end{bmatrix}.

For instance, [31]\begin{bmatrix}3\\1\end{bmatrix} projects to [22]\begin{bmatrix}2\\2\end{bmatrix}. Here the original vector v⃗\vec v and its transformed vector T(v⃗)T(\vec v) appear in the same plot, rather than side-by-side in separate plots as in the previous examples.

Loading...

More generally, if L=span⁡(w⃗)L=\operatorname{span}(\vec w) and w⃗=[w1w2]\vec w=\begin{bmatrix}w_1\\w_2\end{bmatrix} is a unit vector, then projection onto LL has associated matrix

P=[w12w1w2w1w2w22].P=\begin{bmatrix}w_1^2&w_1w_2\\w_1w_2&w_2^2\end{bmatrix}.

For example, consider projecting onto the line spanned by w⃗=[3−5]\vec w=\begin{bmatrix}3\\-5\end{bmatrix}. This vector has length 34\sqrt{34}, so we first normalize it to get the unit direction vector

w⃗∥w⃗∥=[3/34−5/34].\frac{\vec w}{\lVert\vec w\rVert}=\begin{bmatrix}3/\sqrt{34}\\-5/\sqrt{34}\end{bmatrix}.

Substituting these entries into the formula gives

P=[(3/34)2(3/34)(−5/34)(3/34)(−5/34)(−5/34)2]=134[9−15−1525].P=\begin{bmatrix}(3/\sqrt{34})^2&(3/\sqrt{34})(-5/\sqrt{34})\\(3/\sqrt{34})(-5/\sqrt{34})&(-5/\sqrt{34})^2\end{bmatrix} =\frac1{34}\begin{bmatrix}9&-15\\-15&25\end{bmatrix}.

Thus, the transformation is

T([xy])=134[9x−15y−15x+25y].T\left(\begin{bmatrix}x\\y\end{bmatrix}\right)=\frac1{34}\begin{bmatrix}9x-15y\\-15x+25y\end{bmatrix}.

Here is the unit square before and after this projection. After the transformation, both basis vectors lie on the line spanned by w⃗\vec w.

Loading...

A plane

In R3\mathbb R^3, projection onto the xyxy-plane is simple: set the third coordinate to zero.

T([xyz])=[xy0].T\left(\begin{bmatrix}x\\y\\z\end{bmatrix}\right)=\begin{bmatrix}x\\y\\0\end{bmatrix}.

Its associated matrix is

Q=[100010000].Q=\begin{bmatrix}1&0&0\\0&1&0\\0&0&0\end{bmatrix}.

The matrix QQ has shape 3×33\times3 because both the input and output vectors are in R3\mathbb R^3.

For example, [213]\begin{bmatrix}2\\1\\3\end{bmatrix} becomes [210]\begin{bmatrix}2\\1\\0\end{bmatrix}. You can drag the picture below to see the perpendicular drop to the plane.

Loading...

A matrix for projecting onto a plane other than the xyxy-, xzxz-, or yzyz-plane is slightly more complicated. We’ll explore these projections soon.


Lines stay lines

One thing you should have noticed in all of the transformations we’ve visualized is that the shape formed by transforming the standard basis vectors, e.g. the parallelogram below, always contained straight lines — never any curves.

Loading...

This is a general property of linear transformations: points that lie along a line in the domain still lie along a line in the output, unless the entire line collapses to a single point.

For example, use the horizontal shear matrix KK again:

T(v⃗)=Kv⃗,K=[1101].T(\vec v)=K\vec v,\qquad K=\begin{bmatrix}1&1\\0&1\end{bmatrix}.

Follow three points on a line that does not pass through the origin as we apply KK:

[01]⟼[11],[12]⟼[32],[23]⟼[53].\begin{bmatrix}0\\1\end{bmatrix}\longmapsto\begin{bmatrix}1\\1\end{bmatrix},\qquad \begin{bmatrix}1\\2\end{bmatrix}\longmapsto\begin{bmatrix}3\\2\end{bmatrix},\qquad \begin{bmatrix}2\\3\end{bmatrix}\longmapsto\begin{bmatrix}5\\3\end{bmatrix}.

Note that all three points lived on a line before being sent through the transformation, and still live on a line after the transformation. A different line than before, yes, but still a line nonetheless.

Loading...

Why does this happen? Choose a point p⃗\vec p on the line and a nonzero direction vector v⃗\vec v. Every other point on the line is obtained by adding some multiple of v⃗\vec v to p⃗\vec p. Because TT is a linear transformation, it satisfies both of the following properties:

  • T(u⃗+v⃗)=T(u⃗)+T(v⃗)T(\vec u+\vec v)=T(\vec u)+T(\vec v) for every pair of vectors u⃗,v⃗\vec u,\vec v in its domain.

  • T(cv⃗)=cT(v⃗)T(c\vec v)=cT(\vec v) for every vector v⃗\vec v in its domain and every scalar cc.

Applying these properties gives

T(p⃗+tv⃗)=T(p⃗)+T(tv⃗)=T(p⃗)+tT(v⃗).T(\vec p+t\vec v)=T(\vec p)+T(t\vec v)=T(\vec p)+tT(\vec v).

So every output is obtained by starting at T(p⃗)T(\vec p) and adding a multiple of the same direction vector T(v⃗)T(\vec v). The outputs still lie on a line. If T(v⃗)=0⃗T(\vec v)=\vec0, the entire line instead collapses to the single point T(p⃗)T(\vec p).

In many applications, keeping straight lines straight is desirable. When drawing a 3D scene on a 2D screen, for example, we want a straight building edge to appear straight in the image. We’ll explore this idea in just a moment.


Different domain and codomain

So far, each transformation has returned the same number of entries it received. We looked at transformations from R2\mathbb R^2 to R2\mathbb R^2, described with a 2×22\times2 matrix, and transformations from R3\mathbb R^3 to R3\mathbb R^3, described with a 3×33\times3 matrix. But, a transformation can have a different domain (set of possible inputs) and codomain (set of possible outputs).

For example, the function

T:R2→R3,T([xy])=[xyx+y]T:\mathbb R^2\to\mathbb R^3,\qquad T\left(\begin{bmatrix}x\\y\end{bmatrix}\right)=\begin{bmatrix}x\\y\\x+y\end{bmatrix}

copies the two input entries and adds their sum as a third entry. Its associated matrix is

A=[100111].A=\begin{bmatrix}1&0\\0&1\\1&1\end{bmatrix}.

For example,

A[23]=[235].A\begin{bmatrix}2\\3\end{bmatrix}=\begin{bmatrix}2\\3\\5\end{bmatrix}.

The domain is R2\mathbb R^2, the codomain is R3\mathbb R^3, and the matrix has shape 3×23\times2.

As another example, define

T([xyz])=[xy].T\left(\begin{bmatrix}x\\y\\z\end{bmatrix}\right)=\begin{bmatrix}x\\y\end{bmatrix}.

Its associated matrix is B=[100010]B=\begin{bmatrix}1&0&0\\0&1&0\end{bmatrix}.

This has codomain R2\mathbb R^2. Compare it with projection onto the xyxy-plane above: [xy]\begin{bmatrix}x\\y\end{bmatrix} has two entries, while [xy0]\begin{bmatrix}x\\y\\0\end{bmatrix} has three.


Example: computer graphics

Computer games, and engineering software that visualize physical parts, all involve visualizing a three-dimensional world on your two-dimensional computer screen. To convert a three-dimensional world into a two-dimensional representation, we can use a linear transformation! Explore this below.

Start with the overhead view, then drag View toward Game view. Change Building height, and turn on Show basis arrows to see where the three standard basis vectors go.

Loading...

In game view, the transformation uses the matrix

A=[40400−202040].A=\begin{bmatrix}40&40&0\\-20&20&40\end{bmatrix}.

We choose how a one-unit step in each world direction should look on the screen.

  • One step in the world xx-direction should move 40 units right and 20 units down on the screen.

  • One step in the world yy-direction should move 40 units right and 20 units up.

  • One step upward in the world zz-direction should move 40 units up, with no horizontal movement.

These choices tell us where the three standard basis vectors go:

Ae⃗1=[40−20],Ae⃗2=[4020],Ae⃗3=[040].A\vec e_1=\begin{bmatrix}40\\-20\end{bmatrix},\qquad A\vec e_2=\begin{bmatrix}40\\20\end{bmatrix},\qquad A\vec e_3=\begin{bmatrix}0\\40\end{bmatrix}.

Put those three outputs into columns, and we get AA. The numbers 40 and 20 are drawing choices: their ratio makes the ground directions slope by one screen unit vertically for every two units horizontally: downward for the xx-direction and upward for the yy-direction. The 40 in the third column sets how tall a one-unit vertical edge appears. Other choices would give a different view or scale; doubling every entry would double the size of the drawing.

For an arbitrary world point, we combine these three screen movements:

T([xyz])=A[xyz]=x[40−20]+y[4020]+z[040]=[40x+40y−20x+20y+40z].T\left(\begin{bmatrix}x\\y\\z\end{bmatrix}\right)=A\begin{bmatrix}x\\y\\z\end{bmatrix} =x\begin{bmatrix}40\\-20\end{bmatrix} +y\begin{bmatrix}40\\20\end{bmatrix} +z\begin{bmatrix}0\\40\end{bmatrix} =\begin{bmatrix}40x+40y\\-20x+20y+40z\end{bmatrix}.

For example, the ground corner [110]\begin{bmatrix}1\\1\\0\end{bmatrix} appears at [800]\begin{bmatrix}80\\0\end{bmatrix}. The roof corner directly above it has height hh, so

A[11h]=[8040h].A\begin{bmatrix}1\\1\\h\end{bmatrix}=\begin{bmatrix}80\\40h\end{bmatrix}.

The horizontal coordinate stays at 80, while the vertical coordinate is 40 times the building’s height. At height h=1h=1, the roof corner appears at [8040]\begin{bmatrix}80\\40\end{bmatrix}.

The domain is R3\mathbb R^3 and the codomain is R2\mathbb R^2. In the overhead view, we instead use

[40000400].\begin{bmatrix}40&0&0\\0&40&0\end{bmatrix}.

Now the two ground directions appear horizontal and vertical, and height disappears because the third column is zero. The View slider blends this matrix with the game-view matrix; each setting gives a linear transformation. The current matrix AA is shown beneath the transformation in the interactive.