Jump to content
  • Advertisement
Sign in to follow this  
Ternary

Expressing vector aglebra in a matrix

This topic is 4973 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If I have an expression like
(A·V)B where A,V, and B are vectors
is there a way to express this as
MV where M is a square matrix
I'm looking for a general method not dependant on a specific number of coordinates. Also for future reference, what do you call such a conversion?

Share this post


Link to post
Share on other sites
Advertisement
How about this:


M =

[a1*b1 a2*b1 a3*b1 ... an-1*b1 ]
[a1*b2 a2*b2 a3*b2 ... an-1*b2 ]
[a1*b3 a2*b3 a3*b3 ... an-1*b3 ]
[... ... ... ... ... ]
[a1*bn-1 a2*bn-1 a3*bn-1 ... an-1*bn-1 ]














I'm pretty sure that's right, but not 100%.
Quote:
Also for future reference, what do you call such a conversion?
I don't know.

Share this post


Link to post
Share on other sites
Well, jyk's result is correct (though I don't see the reason for stopping at
index n-1, makes it kind of hard to read...).

To see why it is correct, note that A·V is just a number, and can thus be
moved to the right of B, i.e. (A·V)B = B(A·V).
Now, if we use matrix notation for the vectors, A·V can be written A^tV,
where A^t is the transpose of A.
This means that (A·V)B = BA^tV = MV, where M=BA^t, which is exactly jyk's
result in the case of (n-1)-dimensional vectors.

Share this post


Link to post
Share on other sites
Quote:
(though I don't see the reason for stopping at index n-1, makes it kind of hard to read...)
Oops, sorry, should've been 'n'. Just a habit from 0-based indexing...

Share this post


Link to post
Share on other sites
I do believe a(b.c) = (b.c)a because of associativity laws. Or maybe it's commutativity laws.

It's one of them.

Share this post


Link to post
Share on other sites
Quote:
Original post by jlgosse
I do believe a(b.c) = (b.c)a because of associativity laws. Or maybe it's commutativity laws.

It's one of them.


No, matrix multiplication is (usually) not communitive, so a(b.c)!=(b.c)a, but a(b.c)=(a.b)c, under the laws of associativity.

Share this post


Link to post
Share on other sites
Quote:
Original post by eleusive
Quote:
Original post by jlgosse
I do believe a(b.c) = (b.c)a because of associativity laws. Or maybe it's commutativity laws.

It's one of them.


No, matrix multiplication is (usually) not communitive, so a(b.c)!=(b.c)a, but a(b.c)=(a.b)c, under the laws of associativity.


The last equation is wrong. A simple counterexample is to take a = (0, 0, 1) and c = (1, 0, 0). Then the left hand side is (0, 0, (b·c)), which is NOT equal to the right hand side, which is ((a·b), 0, 0).

There is no need to get into commutativity or associativity. The fact that a(b·c)=(b·c)a doesn't need to be proved. (b·c) is just a number (as I said in my original answer), and in the standard definition of a vector space, only (b·c)a is defined, while a(b·c) has no meaning. It is however quite natural to let it mean the same thing, especially if you use matrix notation for the vectors, since in this case, the equation follows from matrix algebra:

[ a1 ] [ a1 ]
[ a2 ][ b·c ] = [ b·c ][ a2 ]
[ a3 ] [ a3 ]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!