A matrix is first and foremost a mathematical form. Mathematics and geometry are deeply intertwined, so understanding matrices geometrically is quite interesting. Work in many fields depends on matrices, so this article collects a few ways of understanding them as notes.
Matric
From the Vector Viewpoint
Consider the example matrix X∈R2×3:X=[142536]
Row Vectors and Column Vectors
This is a matrix with 2 rows and 3 columns. If we focus on the row and column viewpoints respectively, it can be described as:
Row viewpoint. This is a matrix composed of 2 row vectorsv, where v∈R1×3
Column viewpoint. This is a matrix composed of 3 column vectorsv, where v∈R1×2
Under the row and column viewpoints, the matrix can be written as:Xrow=[142536]Xcol=[142536]
Geometric intuition for row and column vectors
One-Dimensional Matrix Vectors
Among them, a single-row or single-column matrix plays an even more special role. Taking a single-row matrix as an example, let X∈R1×2. From the column viewpoint:X=[13]
Its column-vector space is:
Geometric intuition for one-dimensional column vectors
This intuition will be used later in the geometric interpretation of the dot product of two vectors.
That is enough for the vector part for now.
From the Graph Viewpoint
Matrices also have a geometric intuition in graph theory. For example:A=0010010000110000010100011∈R5×5
Directed Graphs
From the row viewpoint, it can be realized as 5 points in a graph space, with each row being a point in 5 dimensions. For each point, dimension n represents the relation between that point and the n-th point, which appears as an edge in graph space.Directed graph
If we extend the matrix entries from just 0 and 1 to more values, then the edges representing those relations can also encode weights:Directed weighted graph
Undirected Graphs
We can adjust the edge relationships by changing the matrix values, turning it into an undirected graph.
Undirected graph (notice the local symmetry)
Graph Connectivity
Now let us return to the original matrix and observe it from the perspective of connectivity. The whole graph can be divided into:
strongly connected components (the red and green parts)
the component-connecting region (the blue part)
Graph connectivity
Matrix Operations
Matrix Addition and Subtraction
If two matrices A∈Rn1×m1 and B∈Rn2×m2 are to be added or subtracted, then their dimensions must match, namely n1=n2,m1=m2.
Under this constraint, matrix addition and subtraction can be understood intuitively as adding or subtracting the row vectors or column vectors one by one. Here we use the column-vector viewpoint as an example:
C=A+B=[14]+[42]=[56]
Matrix addition as vector addition
Matrix Multiplication
If two matrices A∈Rn1×m1 and B∈Rn2×m2 are multiplied, then the prerequisite is m1=n2, that is, the number of columns of A = the number of rows of B.
Why is that? Let us start from the geometric intuition given by the row and column viewpoints.
The Linear-Transformation Viewpoint
Linear Projection of Column Vectors
Suppose three 2×2 matrices are each multiplied by the same 2×1 matrix R:
First, consider N and R:NR=[1001][21]=[21]
I deliberately colored the matrix N in nickel gray, and of course that is intentional.Now look at the geometric picture of this operation:
Linear transformation N
The figure shows a standard two-dimensional Cartesian coordinate system, which lives in a graytwo-dimensional linear space.Within that space, the only column vector of the matrix R, namely [21], lands at the point (2,1) on the axes.
Isn't that obvious? The vector (2,1) should of course land at position (2,1).
No—the heart of the intuition is hidden right there. If we want a vector to be placed perfectly in a two-dimensional Cartesian coordinate system, the following conditions are required:
The vector must be two-dimensional, i.e. (x1,y1)
Its form must be turned from (x1,y1) into (x1⋅i^,y1⋅j^)
Here, i^,j^ are the basis of the two-dimensional spanning space. Since we are currently focusing on vectors, we may call them basis vectors.
What the figure tells us is that the graytwo-dimensional linear space, the matrix N, and the matrix R are related in the following way:
The vector basis i^,j^ is exactly the two column vectors of the matrix N, namely [01],[01], and the number of basis vectors equals the dimension of the column vector of R, which is also the number of matrix rows.
This is the core intuition from the column viewpoint:
The columns of matrix N serve as the basis of the space and span a linear space
The column vectors of matrix R each fall into that linear space (column-vector dimension = the number of basis vectors in the space)
From a geometric viewpoint, this matrix product represents the result of a linear mapping of the column-vector family of matrix R into the space defined by matrix N. In other words, the matrix R undergoes the linear transformation defined by matrix N.
Matrix N is a special linear transformation. Its basis vectors i^,j^ are exactly the unit vectors themselves, so any matrix whose column vectors have dimension 2 is mapped to itself under this transformation. That is why it has a special name—the identity matrix—and the linear transformation it defines is called the identity transformation.
Let us look at a few more examples:GR=[23−32][21]=[18]
Linear transformation G
As shown, the basis vectors of matrix G are i^,j^.This pair of basis vectors can be projected into N-space by left-multiplying the identity matrix (identity transformation):
mathematically, NG=G,
the projected basis vectors are i^=[23],j^=[−32],
visually, the linear transformation G rotates the original space basis counterclockwise by about 60°, while also enlarging it by a factor a little greater than 3.
Now look at another one:BR=[−33−3−3][21]=[−93]
Linear transformation B
The geometric intuition is quite clear:
the projected basis vectors are i^=[−33],j^=[−3−3],
visually, the linear transformation N rotates the unit-space basis counterclockwise by 135°, while also enlarging it by a factor slightly greater than 4.
Now we have the pattern. These two-dimensional matrices can be understood geometrically in terms of rotation and scaling. They look a bit like a sheet of paper in front of you, whose appearance changes as your view tilts or zooms. And in fact, that is not far from the truth. Besides rotation and scaling, there are other possibilities as well. Imagine that a sheet of paper suddenly turns into a line in front of you—what two-dimensional matrix would correspond to that? You can work it out on your own.
Let us return to matrix multiplication. In the previous examples,NRGRBRwe find that linear transformations of column vectors do have an order. For matrix A multiplied by B:
in formula form, we write AB,
intuitively, it means that the linear transformation defined by the matrix on the left, A, acts on the column vectors inside the matrix on the right, B.
We can also understand it in function form, which makes the formula feel more natural:n(R)g(n(R))b(n(R))
Now, with this geometric intuition for linear transformations in mind, let us think about a question. Suppose the linear-transformation effect of B is actually a composition of several different matrix transformations, for example:B[−33−3−3]=PG=[i^j^][23−32]
If you are comfortable with the column-vector view of linear transformations above, then the row-vector case is easy to understand.
Please look at the linear transformation shown below:
Linear transformation G — row-vector viewpoint
At first glance, it looks exactly like the previous linear transformation G.
Exactly.But the difference is that the geometric picture here represents the linear transformation GT, and the matrix product involved is:RTGT=[21][2−332]=[21][i^j^]=[18]
Compare this with what we said earlier from the column-vector viewpoint:
Linear transformations of column vectors do have an order. For matrix A multiplied by B:
in formula form, we write AB,
intuitively, it means that the linear transformation defined by the matrix on the left, A, acts on the column vectors inside the matrix on the right, B.
In the same style, the row-vector viewpoint follows this rule:
Linear transformations of row vectors also have an order. For matrix A multiplied by B:
in formula form, we write AB,
intuitively, it means that the linear transformation defined by the matrix on the right, B, acts on the row vectors inside the matrix on the left, A.
From the column-vector linear-projection viewpoint, matrix multiplication is GR. From the row-vector linear-projection viewpoint, matrix multiplication is RTGT.
In our example, their geometric intuition is the same: the vectors inside the same matrix R are projected into the same linear space spanned by the same set of basis vectors i^,j^.
The Inner-Product (Dot-Product / Scalar-Product) Viewpoint — Row × Column
Let the left matrix be A∈Rm×n and the right matrix be B∈Rn×p. The matrix-multiplication formula is:C=AB=a11a21⋮am1a12a22⋮am2⋯⋯⋱⋯a1na2n⋮amnb11b21⋮bn1b12b22⋮bn2⋯⋯⋱⋯b1pb2p⋮bnp=a1Ta2T⋮amT[b1b2⋯bp]=a1Tb1a2Tb1⋮amTb1a1Tb2a2Tb2⋮amTb2⋯⋯⋱⋯a1Tbpa2Tbp⋮amTbp=c11c21⋮cm1c12c22⋮cm2⋯⋯⋱⋯c1pc2p⋮cmp,
Here, the i-th row vector of A is denoted by aiT∈R1×n, and the j-th column vector of B is denoted by bj∈Rn×1.
The element in the i-th row and j-th column of the resulting matrix C is denoted by cij, and it represents the dot product between the row vector aiT from the left matrix and the column vector bj from the right matrix:cij=aiTbj=k=1∑naikbkj
Let us build the intuition step by step through an example:C=AB=361242125130214=a1Ta2Ta3T[b1b2]=a1Tb1a2Tb1a3Tb1a1Tb2a2Tb2a3Tb2=a1⋅b1a2⋅b1a3⋅b1a1⋅b2a2⋅b2a3⋅b2=9187122424
Here, if we take any one of these dot products, say q⋅k=ai⋅bj, its expanded formula is:q⋅k=[q1q2q3]k1k2k3=[q1k1+q2k2+q3k3]
The geometric intuition of this computation process is shown here:
Row-column dot product
It looks like a network structure, in which:
the red row vectors (objects) form the nodes on the left,
the blue column vectors (operators) form the connecting edges,
the green row vectors (dot-product results) form the output nodes on the right.
The result of taking the dot product between a row vector from the left matrix and a column vector from the right matrix, aiTbj=ai⋅bj, is a scalar value (it is not represented as a 1×1 matrix in the matrix result).
Besides being understood as the green nodes in the network above, this scalar also has a more general geometric interpretation.
Intuition for the Vector Dot Product
The dot product of two vectors, q⋅k (I secretly reduced the dimension a bit for the sake of the following demonstration), actually has a hidden equality:q⋅k=(q1,q2)⋅(k1,k2)=q1k1+q2k2=[q1k1+q2k2]=[q1q2]⋅[k1k2]=[q1q2][k1k2]=[k1k2][q1q2]
From the linear-transformation viewpoint above, as long as we can grasp i^,j^, the operation in this equality is easy to understand: one vector defines a linear space that acts on the other vector. This leaves us with the question: when the dimension of i^,j^ is 1, how should we form a geometric intuition for the linear space they define?
Let us plug some numbers into the expression:q⋅k=[32][xy]
Now, with i^=[3],j^=[2], what is the linear space defined by them?The derivation goes as follows:
First, in the linear space of unit vectors, the vector q=(3,2) is projected into it.
Vector (3,2)
Next, place a unit number line (with unit length 1) so that its positive direction aligns with the vector q=(3,2).Other vectors can then be orthogonally projected onto this number line to obtain a new representation, and this process satisfies:
Vector addition in the unit space still holds after projection onto the number line (additivity)
Vectors in the unit space with the same direction but different lengths still preserve the same proportion after projection onto the number line (homogeneity)
Orthogonal projection of vectors onto a number line
Conjecture:after vector k undergoes the linear transformation defined by the one-dimensional matrix [32], the result can be understood geometrically as the length of the orthogonal projection of the vector onto the number line.
If this is true, then under the space defined by the identity matrix, we should have:
the result of [32][ab] equals the projection length of (a,b)
Some projection cases are shown below:Projection cases for several vectors
the signed projection length of (1,0) is 3/13, while [32][10]=(3,2)⋅(1,0)=3⋅1+2⋅0=3=13⋅3/13
the signed projection length of (−1,0) is −3/13, while [32][−10]=(3,2)⋅(−1,0)=3⋅(−1)+2⋅0=−3=−13⋅3/13
the signed projection length of (0,1) is 2/13, while [32][01]=(3,2)⋅(0,1)=3⋅0+2⋅1=2=13⋅2/13
the signed projection length of (3,2) is 13, while [32][32]=(3,2)⋅(3,2)=3⋅3+2⋅2=13=13⋅13
So the conjecture does not hold. But strikingly, we find that the discrepancy lies in 13 and −13.Then suppose the unit length on our number line is not 1 but 13, as shown below:
Changing the unit length on the number line
Now it matches:[32][32]=(3,2)⋅(3,2)=3⋅3+2⋅2=13=13⋅13=readingonthescaleofthenumberlineinthedirectionwheretheorthogonalprojectionlies×orthogonalprojectionlength
Therefore, after vector k undergoes the linear transformation defined by the one-dimensional matrix [32], the result can be understood geometrically as: the orthogonal projection length of vector k onto a number line whose unit length equals that of vector (3,2), multiplied by the scale reading at the point where the projection lands.
Then which one-dimensional matrix corresponds to the number line in the figure on the left? You can work that out on your own.
This proof refers to the mathematics creator 3Blue1Brown's Linear Algebra: Dot Products. His linear algebra series is very much worth watching.
With the geometric intuition of vector dot products in place, matrix operations become even more vivid from the dot-product viewpoint.
The Outer-Product Viewpoint — Column × Row
Let the k-th column vector of A be denoted by ak∈Rm×1, and the k-th row vector of B be denoted by bkT∈R1×p. Then the formula from the outer-product viewpoint is:
We still use the example from the inner-product viewpoint:C=AB=361242125130214=[a1a2a3]b1Tb2Tb3T=a1b1T+a2b2T+a3b3T=a1⊗b1+a2⊗b2+a3⊗b3=361[12]+242[31]+125[04]=3616122+6126242+0004820=9187122424
Column-row outer product
The outer product between a column vector from the left matrix and a row vector from the right matrix, aiTbj=ai⊗bj, appears as a submatrix, and the sum of all such submatrices equals the result matrix C.This is the geometric intuition from the outer-product viewpoint.
Closing Remarks
As a mathematical form, matrices do a remarkably good job of decomposing and analyzing how parts of physical reality operate. Because of their power, more and more domains of knowledge treat matrices as an essential component. Without the necessary background, some of those fields can look like towering mountains, breathtaking in their scale.
And yet every mountain is built from countless tiny grains. Looked at from one angle it is a ridge, from another a peak. The right prerequisite knowledge provides the right viewpoint. Just like the linear space of a one-dimensional matrix, there is always a way to flatten the terrain, walk it as if on level ground, and one day look down from the summit.
This article offered geometric intuition for matrices from several common viewpoints, and I hope it helps.
Appendix
Linear Transformation P
Linear transformation P
Imagine the linear space of B as a blue sheet of paper, while the linear space of G is a green sheet of paper.
The geometric intuition of P is therefore: what must be done to turn the green sheet into the blue sheet?
Intuitively: rotate it counterclockwise by nearly 90°, while also enlarging it by a factor a little greater than 1.