Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Linear Algebra - Multiplying a matrix and vector.

  1. Aug 13, 2010 #1
    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?
     
  2. jcsd
  3. Aug 13, 2010 #2

    mathman

    User Avatar
    Science Advisor

    Since the matrix is diagonal, it doesn't matter.
     
  4. Aug 13, 2010 #3

    How so?
     
  5. Aug 13, 2010 #4
    you are correct. that's a mistake - it should be on the right.
     
  6. Aug 14, 2010 #5
    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?
     
  7. Aug 14, 2010 #6
    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.
     
  8. Aug 15, 2010 #7

    HallsofIvy

    User Avatar
    Science Advisor

    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.
     
  9. Aug 15, 2010 #8

    arildno

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    Dearly Missed

    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)
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook