What Is a Matrix? Operations and Applications Explained

A matrix isn't just a grid of numbers. It's an instruction for moving every point in space at once. Here's how that one idea explains the transpose, the inverse, and why rotation in every video game is one small matrix.

By Petrus Sheya

August 11, 2026 · 6 min read

What is a matrix, really? Not the movie. The grid of numbers from school, rows and columns, with a multiplication rule attached that felt like it came out of nowhere.

Most people learn the grid and stop there. Add these, multiply those, don't ask why. But a matrix is something sharper than a grid: it's a compact set of instructions for moving every point in space at once. Once you see it that way, its operations stop feeling arbitrary, and it becomes obvious why the same idea shows up in image editors, video games, and search engines.

We already broke down addition, scalar multiplication, and the row-times-column rule in Introduction to Matrices. Here we're going one level up: what a matrix does, how to flip it, how to undo it, and where it earns its keep.


A matrix is a grid. But that's the boring part.

Take a simple 2×22 \times 2 matrix:

M=[2011]M = \begin{bmatrix} 2 & 0 \\ 1 & 1 \end{bmatrix}

You could read this as four numbers in a box. Or you could read the columns as directions. The first column, (2,1)(2, 1), tells you where the point (1,0)(1, 0), call it "east", ends up after MM is applied. The second column, (0,1)(0, 1), tells you where "north", the point (0,1)(0, 1), ends up.

And here's the payoff: that's all you need. Every other point in the plane is just some mix of east and north. Once you know where those two land, you know where everything lands, because MM treats every point the same way. It's one instruction, applied everywhere.

Drag the tip of the east arrow. Every other point of the square follows, because the matrix is just an instruction for where east and north land.

north (fixed)

Drag the gold handle. It's the only thing you're changing.

East lands at(1.40, 0.40)
Area multiplier (det)1.40

Drag the handle and watch the whole square warp with it. Notice something specific: dragging straight up or down doesn't change how much area the square covers. Dragging sideways does. That's not a coincidence. It's the geometric meaning of the determinant, the number that tells you how much a matrix stretches or shrinks area. We write it det(M)\det(M), and for a 2×22\times2 matrix:

det(M)=adbcforM=[abcd]\det(M) = ad - bc \quad \text{for} \quad M = \begin{bmatrix} a & b \\ c & d \end{bmatrix}

Keep that number in your back pocket. It's about to decide whether a matrix can be undone.


What does flipping a matrix on its side actually do?

Say you're tracking shipments. Two warehouses, three products. Matrix AA holds how many units of each product sit in each warehouse.

A=[407251]A = \begin{bmatrix} 4 & 0 & 7 \\ 2 & 5 & 1 \end{bmatrix}

Now someone asks a different question: not "what's in this warehouse," but "where is this product stored." Same data, different question. To answer it, you flip the table so products become rows and warehouses become columns. That flip has a name: the transpose, written ATA^T.

(AT)ij=Aji(A^T)_{ij} = A_{ji}

The rule is simple once you say it out loud: whatever sat at row ii, column jj moves to row jj, column ii. A 2×32 \times 3 matrix becomes a 3×23 \times 2 matrix. Nothing about the numbers changes, only their addresses.

Click a cell in A. Its mirror lights up in Aᵀ, in the swapped position.

A (2 × 3)407251Aᵀ (3 × 2)420571

a12 in A becomes a21 in Aᵀ. Same number, swapped address.

Value0
Position in A(1, 2)
Position in Aᵀ(2, 1)

Click around and watch the mirror. Entries along the diagonal never move (there's no diagonal here since the matrix isn't square, but for square matrices, a11,a22a_{11}, a_{22}, and so on stay put). Everything else swaps across it. Transpose doesn't touch a single value. It just relabels where each value lives.


Can you always undo what a matrix did?

Here's a question worth sitting with. If a matrix moves every point somewhere new, is there always a way back? Some other matrix that takes each moved point and sends it home?

Sometimes, yes. That "undo" matrix is called the inverse, written M1M^{-1}, and it satisfies:

M1M=IM^{-1}M = I

where II is the identity matrix, the "do nothing" transformation that leaves every point exactly where it started. For a 2×22 \times 2 matrix, there's a direct formula:

M1=1det(M)[dbca]M^{-1} = \frac{1}{\det(M)} \begin{bmatrix} d & -b \\ -c & a \end{bmatrix}

Look at what's sitting in the denominator: det(M)\det(M), the same number from the last section. If det(M)=0\det(M) = 0, that formula asks you to divide by zero. No inverse exists. Geometrically, this is what a determinant of zero means: the transformation squashed a whole shape down onto a line, or a point, and once information is gone like that, there's no instruction that brings it back.

Press play: the triangle gets transformed by M, then by M⁻¹. When M is invertible it lands right back where it started.

Forward, then undo.

det(M)3.00
Invertibleyes
M⁻¹[0.3, 0.3; -0.3, 0.7]

Slide toward s=1s = 1 and press play. Watch the triangle collapse into a sliver as the determinant heads toward zero. Past that point, the "undo" step has nothing to work with. A matrix is only invertible when it doesn't throw information away.


So where does any of this actually show up?

Transformations, transposes, and inverses aren't just textbook exercises. They're the working parts behind a lot of software you use daily. A few concrete cases:

  • Solving systems of linear equations is really running a matrix backward, using its inverse to undo a transformation and recover the original input.
  • Search engines and recommendation systems, like the one behind Netflix's recommendations, factor a giant matrix of ratings into smaller pieces to find hidden patterns.
  • Every rotation you see in a video game, a CAD tool, or a photo editor is one small matrix, multiplied against every point of the object being spun.

That last one is worth building by hand, because it ties every idea from this post together. A rotation by angle θ\theta is done with:

R(θ)=[cosθsinθsinθcosθ]R(\theta) = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix}

Drag the needle or use the dial. R(θ) is the matrix that rotates every point by the same angle at once.

R(θ)[0.82, -0.57; 0.57, 0.82]
det(R)1.00

det(R) never changes: rotating never stretches or shrinks anything. And R⁻¹ = Rᵀ, the flip from earlier undoes the spin.

Drag the needle around. Notice the determinant never moves off 1.001.00, no matter what angle you pick. That makes sense: a rotation doesn't stretch or shrink anything, it just spins it, so it shouldn't touch area at all. And here's a nice bonus fact hiding in this one matrix: for a rotation, the inverse and the transpose are the same matrix. R(θ)1=R(θ)TR(\theta)^{-1} = R(\theta)^T. Spin something the wrong way, and flipping the matrix on its side undoes the spin exactly. Two operations from earlier in this post, turning out to be one and the same, right here.

If you want the geometric reason why that shortcut works for rotations specifically, orthogonal matrices are the general case, and the determinant post covers how to compute det(M)\det(M) by hand for anything up to 3×33 \times 3.


The short version

A matrix is a set of instructions for moving every point in space, built from where it sends two basic directions. The transpose flips those instructions across the diagonal, swapping row addresses for column addresses without touching a single value. The inverse undoes the instructions entirely, but only when the determinant isn't zero, only when no information got thrown away along the trip. And that whole toolkit, transform, transpose, invert, is what's quietly running underneath rotation in graphics, ranking in search, and recommendations on your screen right now.

None of it is arbitrary. It's just what falls out of treating a grid of numbers as a machine, instead of a spreadsheet.


All visualizations are interactive React components running entirely in your browser. Every animation uses requestAnimationFrame for timing. No libraries beyond React.