Home / Linear Algebra

A Matrix is a Transformation

Drag the four numbers and watch space itself rotate, stretch and shear. The columns of the matrix are simply where the two basis vectors land.

The Matrix

1.0
1.0
0.0
1.0

1.00

0 = untouched, 1 = fully transformed

Space, Transformed

det = 1.00

Green is where the first basis vector lands, blue the second. The shaded patch was the unit square.

What It Does

Determinant
1.00
signed area of the unit square
Area Scale 1.00×
Orientation kept
Rank 2
Invertible? yes

Where the Basis Lands

î = (1, 0) →
(1.0, 0.0)
ĵ = (0, 1) →
(0.0, 1.0)

These are exactly the two columns of the matrix. That is the whole trick: a matrix is a record of where the basis vectors go, and everything else follows.

A Matrix as a Transformation

The columns of a matrix show where the coordinate directions go, which explains matrix–vector multiplication.

What changes and what survives

Matrices can rotate, shear, stretch, reflect, or collapse space. A singular matrix loses a direction, so different inputs can map to the same output and no inverse can recover the original. For square matrices, determinant zero identifies singularity; rank counts the surviving independent directions. See determinants, rank, and eigenvectors.

Applying B and then A gives ABx: the rightmost matrix acts first on column vectors. Transformations generally do not commute, so reversing their order changes the result. A neural-network layer uses a linear map plus a bias; its activation function adds the nonlinearity.

Why a matrix is a linear map

A linear transformation preserves addition and scalar multiplication: A(u+v)=Au+Av and A(cv)=cAv. This is why the images of the standard basis vectors determine every output. For A=[[2,1],[0,1]], the first column says the x-axis unit vector maps to (2,0), while the second says the y-axis unit vector maps to (1,1). Combining 3 copies of the first image and 2 of the second gives A(3,2)=(8,2).

A translation such as x↦Ax+b is affine, not linear unless b=0, because it does not keep the origin fixed. Neural-network layers often use this affine map before a nonlinear activation. For column vectors, AB means B acts first and then A; the order matters because a shear followed by a rotation usually differs from the reverse. A singular map squashes at least one direction, so the output cannot uniquely determine the input. Use rank to count surviving directions and determinants for signed volume scaling.

Try this above

Apply a rotation, then a stretch, and compare with the same operations in reverse order. Watch the grid and the basis-vector readouts.

A practical way to verify a proposed matrix is to apply it to each standard basis vector. The first output must equal the first column and the second output the second column under the column-vector convention. This catches a common row-versus-column mistake. The determinant describes area change in two dimensions, but individual directions may still stretch by different amounts; eigenvectors and singular values expose those directions. A matrix's entries are therefore tied to a coordinate system, while the linear map is the underlying action.

The image of a grid reveals global behaviour, while basis-vector images identify the map algebraically. If two columns are parallel, the map collapses the plane to a line; if the columns are perpendicular unit vectors, the map is a rotation or reflection. Most matrices combine rotation, scaling, shear, and possibly collapse. Singular value decomposition separates these effects into orthogonal changes of coordinates and axis-wise stretching.

Sources and next steps

Overview

Read the columns

A linear map preserves sums and scaling. In two dimensions, knowing where the basis vectors (1, 0) and (0, 1) go determines where every vector goes. Those two destination vectors are the columns of the matrix:

A(x, y) = x·A(1,0) + y·A(0,1)

For A = [[2, 1], [0, 1]], the basis directions map to (2, 0) and (1, 1). Thus A(3, 2) = 3(2, 0) + 2(1, 1) = (8, 2). The columns are not just a storage convention; they encode the transformation.

Predict, then reveal

About to run: set Entry a to its minimum (-3). Before it does — what happens to the readout?

Committing to an answer first is the point — the reveal runs the experiment on the visualisation above and reads the real value back, so nothing here is scripted.

Check yourself

0 of 2

Answer without scrolling back up.

  1. In a matrix acting on column vectors, what does the first column represent?

  2. What does a zero determinant mean for a square linear map?

Cheat sheet

A Matrix is a Transformation

Drag four numbers and watch space rotate, stretch and shear. The columns are where the basis vectors land, and the determinant is the area they span.

MATHS · vizlearn.in/maths/matrix_as_transformation.html

About the author

Ashish Jangra builds and maintains VizLearn. Every module here is written and the visualisation behind it hand-built, so the numbers in a readout come from the same code that draws the picture. Corrections are genuinely welcome and get priority over everything else — if a page states something wrong, or an animation misrepresents what the algorithm does, get in touch.