Linear Algebra - Multiplying a matrix and vector.

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
7 replies · 3K views
jinksys
Messages
122
Reaction score
0
I am reading OpenGL SuperBible 5th Edition and noticed something off.
2jMWHl.jpg


I just took linear algebra and was always told to make sure that the rows and columns match when multiplying two matrices. The vector should be on the right side of the matrix, correct?
 
Physics news on Phys.org
mathman said:
Since the matrix is diagonal, it doesn't matter.


How so?
 
you are correct. that's a mistake - it should be on the right.
 
Maybe that book defines matrix multiplication in a different way. But your example doesn't show this that much. Do you have a less simple example?
 
jinksys said:
I am reading OpenGL SuperBible 5th Edition and noticed something off.
2jMWHl.jpg


I just took linear algebra and was always told to make sure that the rows and columns match when multiplying two matrices. The vector should be on the right side of the matrix, correct?

You are correct. The diagram is incorrectly denoting the result of the square matrix premultiplying the column vector.
A matrix can be premultiplied by a row vector to yield another matrix, but there is no formal method of premultiplying a matrix directly by a column vector.
 
I believe mathman was referring to
[tex]\begin{bmatrix}a & b & c & d \end{bmatrix}\begin{bmatrix}t & 0 & 0 & 0 \\ 0 & u & 0 & 0 \\ 0 & 0 & v & 0 \\ 0 & 0 & 0 & w\end{bmatrix}[/tex]
and
[tex]\begin{bmatrix}t & 0 & 0 & 0 \\ 0 & u & 0 & 0 \\ 0 & 0 & v & 0 \\ 0 & 0 & 0 & w\end{bmatrix}\begin{bmatrix}a \\ b\\ c \\ d\end{bmatrix}[/tex]

Of course, that is not what is shown in the first post.
 
Hi, jinksys!

Nice of you to spot that error.

You should learn first the row*column-multiplication-type, although it is perfectly possible to define more general multiplication rules.
(And, this is done, for example by the highly general index-multiplication method)