I took an informal poll of my friends and it turns out we all intially learned a method of matrix multiplication in school which I call row oriented multiplication. However, the friends who had been working with linear algebra for a long time frequently used a more intuitive method which I call column oriented multiplication. Here I’ll explain the difference and try to show why the column oriented point of view should be a useful tool in your toolbox, especially if you are working in a field that is heavy in linear algebra (e.g. robotics).
Row Oriented Multiplication
When I learned how to multiply vectors and matrices, it went something like this.
Or if you prefer formulas, it went like this.
I call this row oriented multiplication. It definitely works but it often hides the geometrical content of a matrix behind nasty algebra. Consider this rotation matrix.
We can verify that the axis of rotation is the z-axis with row oriented multiplication by seeing that a point on the z axis is unaffected by multiplication with .
Now I’ll introduce column oriented multiplication and how it not only simplifies the previous calculation but also reveals the geometrical content of the matrix.
Column Oriented Multiplication
First let’s establish the notation that for any matrix , means the column of . We obviously have .
Column oriented multiplication of works like this. We use the columns of as vectors.
There are multiple ways to verify that this leads to the same result as row oriented multiplication. I’ll show a really easy way in the appendix. But for now let’s see how column oriented multiplication can be applied.
Using Column Oriented Multiplication
First let’s redo our previous calculation involving our rotation matrix using column oriented multiplication.
We can completely ignore the first two columns of , and compute the answer simply by reading off the third column of and multiplying by . We arrive at the same answer we got with row oriented multiplication.
Now recall the notation for the standard basis vectors.
Visualize as points on the x, y, and z axis respectively. Using column oriented multiplication we can quickly see these relationships.
This means that the geometrical content of — the way it acts on the coordinate axes — can be entirely read off from its columns!
(read the arrows as “rotates to”)
Try carrying out this rotation on your thumb as , your index finger as , and your middle finger as . Also note that is redundant since it must be perpendicular to and .
The story doesn’t end here. Once I got into the habit of seeing matrix multiplication this way, I started to have insights into the nature of other types of matrices, including Jacobian matrices which are ubiquitous in robotics algorithms. But I’ll save that for another post.
Appendix
In all matrix multiply expressions that follow, assume that we are using row oriented multiplication.
(verify, with row oriented multiplication that )
So we end up with the formula for column oriented multiplication .