Quantcast
Channel: The Stata Blog - Latest Comments
Viewing all articles
Browse latest Browse all 1126

Re: Understanding matrices intuitively, part 1

$
0
0

It blows my mind that is not how linear algebra is introduced, I realized the same thing doing computer graphics and now find matrices easy.

What's more, you can explain vector-matrix multiplication intuitively this way. All you're doing is splitting the vector into its coordinates, and mapping them onto the distorted grid, using the rows or columns of the matrix as new basis vectors.

Matrix-matrix multiplication can then be done by splitting one matrix into its rows or column vectors, and transforming them individually as vectors using this principle.

The asymmetry of matrix multiplication is explained by doing this process twice, once from the left, using rows as vectors, and once from the right, using columns as vectors. You will find you have written out the same algorithm in two different ways.

And for the real kicker: you can explain homogeneous coordinates / projective transforms intuitively. Imagine you're playing an FPS game like Portal and you're looking around standing at a fixed position. Your brain tells you you are seeing a 3D space rotate around a common origin (i.e. an affine matrix transform). But really, the screen is showing 2D shapes scrolling through your field of view, i.e. translating. So, if you express 2D shapes as 3D shapes floating in front of a camera, you can use 3D matrix transforms to perform 2D translations, and you get perspective projections for free. This principle is applied everywhere in computer graphics, leading to 4D matrices/vectors for 3D engines.


Viewing all articles
Browse latest Browse all 1126

Trending Articles