Skip to content

Visualize Different Matrices part2 | SEE Matrix, Chapter 1

Explore shear, orthogonal, projection, and inverse matrices with visual explanations and their geometric transformations in 2D and 3D.

Ask about this video. Answers come from its transcript only — with the timestamp, so you can check them.

Generated from the transcript and can be wrong — check the timestamp.

Key Takeaways

  • Shear matrices change shape but preserve area, unlike scalar matrices.
  • Orthogonal matrices represent pure rotations with unit, orthogonal column vectors.
  • Matrix multiplication is a composition of sequential transformations and is not commutative.
  • Projection matrices map vectors onto subspaces but are not invertible due to information loss.
  • Inverse matrices exist for many transformations and undo their effects, restoring original vectors.

What the video covers

  • Shear matrices produce shear transformations that slant shapes like rectangles into parallelograms while preserving area.
  • In 2D, shear transformations can be applied in four directions parallel to the x- or y-axis; in 3D, shear involves planes and directions.
  • Orthogonal matrices consist of unit, mutually perpendicular column vectors and represent pure rotations without scaling or shearing.
  • Matrix multiplication represents sequential transformations, and the order of multiplication affects the resulting transformation, proving non-commutativity.
  • Projection matrices compress vectors onto subspaces, such as lines or planes through the origin, moving vectors to their closest points on the subspace.
  • Inverse matrices reverse specific transformations, restoring vectors to their original positions, but not all matrices (e.g., zero or projection matrices) are invertible.
  • Matrix visualization is a human construct to help intuitively understand abstract linear algebra concepts and transformations.
  • The video emphasizes the importance of rotations in unlocking complex linear transformations and the composition of transformations through matrix multiplication.
  • Subspaces are abstract concepts but can be visualized as infinite lines or planes through the origin in 2D or 3D space.
  • The video concludes with reflections on the broader significance of matrices in fields like probability and data science and the value of visual intuition.

Answers

Questions about this video

What is a shear matrix and what does it do?

A shear matrix produces a shear transformation that slants shapes like rectangles into parallelograms by moving vectors parallel to an axis, while preserving the area.

What defines an orthogonal matrix and what transformation does it represent?

An orthogonal matrix is a square matrix whose column vectors are unit vectors and mutually perpendicular, representing a pure rotation without scaling, shearing, or reflection.

Why is matrix multiplication not commutative?

Matrix multiplication represents sequential transformations, and changing the order of these transformations changes the final result, so AB does not generally equal BA.

Full Transcript — Download SRT & Markdown

00:02
Speaker A
Continued from part one, we have the shear matrix, which is a matrix that produces a shear transformation.
00:09
Speaker A
But, what is a shear transformation? Turns out, it's not the easiest to describe verbally, so you have to see it for yourself.
00:16
Speaker A
The matrix 1101 is a shear matrix. And this is what it does. What we see is all the vectors above the origin were moving towards the right.
00:27
Speaker A
And all the vectors below the origin were moving towards the left. And the way they move was actually parallel to the x-axis.
00:34
Speaker A
So, overall, the rectangle was slanted into a parallelogram. In 2D, there are four directions we can apply a shear transformation.
00:43
Speaker A
Two different ways we can shear in parallel to the x-axis, and two ways in the y-axis.
00:51
Speaker A
It's also notable to mention a property shear matrices have, which is the transformation preserves the area of the object, despite changing the shape.
01:01
Speaker A
Which forms a distinction with the scalar matrix from earlier, which preserves the shape, but changes the area.
01:08
Speaker A
A three-dimensional shear is kind of hard to describe. Personally, I'd like to imagine there's a plane slicing through the origin, and there's a direction associated with this plane.
01:18
Speaker A
All vectors are moving parallel to the plane, while slanting towards the direction. Mhm, maybe that was not the best angle to observe a shear transformation in 3D.
01:30
Speaker A
So, let me change the orientation of my camera a little bit. And for every combination of this plane and direction, it would have its own corresponding shear transformation matrix.
01:57
Speaker A
Next, the orthogonal matrix. This one is very important for chapter two and three. It's a square matrix. Every column vector is a unit vector, and they're all orthogonal to each other.
02:10
Speaker A
Let's dissect the definition a little bit. So, what is a column vector? Basically, if we vertically slice through the matrix into columns, each column is a vector. This is the reason why some people say a matrix is a collection of
02:24
Speaker A
vectors. For a column vector to be a unit vector, it means the magnitude is one. In our case, the length of the arrow is one.
02:33
Speaker A
For a counterexample, the red arrows on the screen are not unit vectors because they're too long.
02:39
Speaker A
How about orthogonal? So, the formal definition for orthogonal is when you take the dot product between two vectors, the number you get is zero.
02:49
Speaker A
And when the dot product is zero, visually, it actually translates to the two vectors being perpendicular to each other.
02:59
Speaker A
This one is an orthogonal matrix. We can quickly verify the two column vectors are unit and orthogonal.
03:06
Speaker A
What kind of transformation does it have? Wow. A perfect rotation. No scaling, no stretching, no shearing, no reflection, but a pristine rotation.
03:20
Speaker A
You might say, "Come on, it's just rotation. There's nothing special." But it turns out finding the correct direction to rotate is a gateway to unlock all complexity with linear transformation.
03:32
Speaker A
And it just happens the transformation an orthogonal matrix produces is always a rotation to some degree.
03:40
Speaker A
Inductively, a 3 by 3 orthogonal matrix produces a rotation in three dimensions, and you can also rotate around the Z axis now.
03:50
Speaker A
Actually, now's a really good time for me to once again emphasize the idea that matrix to matrix multiplication is nothing but a composition of sequential transformations.
04:01
Speaker A
Suppose I tell you orthogonal matrix A produces a rotation around the x-axis by 60°.
04:09
Speaker A
And matrix B produces rotation around the z-axis by 45°. If I multiply those two matrices together to get a matrix C, what do you think C is going to do?
04:20
Speaker A
Well, let's see. Firstly, around X and immediately around Z. Since our matrix C is a composition of the two, like you guessed it, it encapsulates the two sequential transformations but in just one rotation.
04:39
Speaker A
If you had noticed, I really tried to punctuate the word sequential just now because suppose we reverse the sequence of the two rotations, namely Z first then X.
04:50
Speaker A
We actually get something different than the original composition. Look at the position of the orange cube.
04:56
Speaker A
It's different. This is actually an example to prove matrix composition or matrix multiplication is not commutative.
05:06
Speaker A
Which is saying matrix B times A is not always equal to A times B.
05:21
Speaker A
Projection matrix. Actually, before defining a projection matrix, we need to understand what is a subspace.
05:28
Speaker A
And just like all other definitions in linear algebra, the definition for subspace is pretty abstract. At the moment, allow me to just provide you with some examples. In 2D, a line crossing through the origin is a subspace of R2.
05:42
Speaker A
And this line is infinitely long. In 3D, a plane crossing through the origin is a subspace of R3.
05:52
Speaker A
I'm only showing you a small region of the subspace here, but in reality, you should imagine the subspace actually spreads to infinity.
05:59
Speaker A
For every subspace that exists, our computer can calculate its corresponding projection matrix, which would move every vector outside the subspace onto the subspace.
06:11
Speaker A
Let's take a look at the projection matrix of this blue line here. After the projection transformation, every single dot has been compressed onto the line.
06:21
Speaker A
How about the projection matrix of this plane in 3D? Yet another very similar vibe of compression.
06:31
Speaker A
The reason why this is called projection is because every vector always moves to its closest point on the subspace.
06:38
Speaker A
For example, the vector 2 1 is currently outside the blue line, and its closest point would be here.
06:45
Speaker A
Applying the projection matrix would move our vector 2 1 exactly over there. And this is true for every single vector outside the subspace.
06:56
Speaker A
As targets of projection matrix, they all move towards their closest landing spot. And the fun fact, if some alien civilization destroyed our solar galaxy by compressing us into a lower dimension, this kind of transformation is similar to a projection matrix.
07:31
Speaker A
The very last, but not the least, we talk about the idea of inverse. So far, we have seen a lot of different matrices, and therefore many different transformations. All those transformations were moving our vectors to new coordinates.
07:44
Speaker A
But what if I don't like a particular transformation I had? Maybe it distorted my image a little bit. I just want every vector to go back where they originally came from.
07:54
Speaker A
Is there one matrix that can untransform the previous transformation for me? Unfortunately, the short answer would be no.
08:02
Speaker A
There isn't one matrix that does the universal untransformation. But for every matrix you're interested in, our computer can calculate its inverse, which is another matrix that is capable of that particular untransformation.
08:18
Speaker A
For example, the matrix which scales, its inverse matrix unscales. The matrix which reflects, its inverse reflects back.
08:29
Speaker A
The matrix which rotates, its inverse rotates back. The matrix which shears, its inverse unshears.
08:41
Speaker A
Or this matrix here, not sure what it did, but its inverse matrix restores all vectors back to the original.
08:50
Speaker A
Notice, when you apply a matrix and then you apply its inverse, it's like nothing happened.
08:56
Speaker A
Just like the identity matrix. This is the reason when you multiply a matrix and its inverse, you always get the identity matrix. When you compose the two transformations together, you get a transformation of no transformation.
09:10
Speaker A
However, some matrices cannot be inverted. The zero matrix and projection matrix from earlier cannot be untransformed.
09:18
Speaker A
It actually kind of makes sense visually because a vector has been squashed from a higher dimension down to a lower dimension. There is a loss of information.
09:35
Speaker A
After a long journey, we have gone through all those cool matrices. So, what exactly is a matrix?
09:45
Speaker A
Does a matrix intrinsically carry a visual value? Frankly, not at all. Everything I did was only a very artificial attempt to make sense of matrices. You could say matrix visualization is just another human construct.
10:01
Speaker A
This moment, I'd like to reference a quote from my favorite author. He was asked whether his readers could interpret the symbolism in his novel the way he intended to convey. He answered, "The books belong to the readers now,
10:14
Speaker A
which is a great thing because the
10:21
Speaker A
The interpretation of matrix belongs to whoever is using it. For a student who studies circuit, matrix is just a tool to solve system of equation. Personally, I still have some PTSD from Gaussian elimination.
10:35
Speaker A
For probability student, matrix is a best representation of a Markovian process. For data scientist, a matrix is just a manifestation of a table, which facilitates data analysis.
10:47
Speaker A
And for the deep learning folks, matrix is just another Python function, which takes a vector as input and returns a vector as output.
10:56
Speaker A
And this list really goes on. Perhaps, there isn't the definition of matrix, but only interpretations of matrices.
11:10
Speaker A
Then, what is so good of the visual interpretation? Firstly, I think it provides us with intuition about matrix transformation on vector.
11:19
Speaker A
And secondly, computer graphic is a direct extension of this. Thirdly, the one I like to elaborate on personally, which is a very important topic of matrix decomposition.
11:32
Speaker A
There are matrices out there whose transformation so perplexing I cannot easily articulate. And there are matrices taking vector from higher space to a lower space.
11:43
Speaker A
Is there a possibility we can re-express those complicated transformation into a sequence of simple transformation such as rotation or scaling?
11:52
Speaker A
And that's where we're heading towards next chapter two. What Professor Gilbert Strang calls the king of all matrices.
11:59
Speaker A
And let you and me go spectate the spectacular spectral decomposition. See you there.
Topics:shear matrixorthogonal matrixprojection matrixinverse matrixlinear transformationmatrix multiplicationsubspacerotation matrixmatrix visualizationlinear algebra

Get More with the SozAI App

Transcribe recordings, audio files, and YouTube videos — with AI summaries, speaker detection, and unlimited transcriptions.

Or transcribe another YouTube video here →