On 3/22/07, Ryan Krauss <ryanlists at gmail.com> wrote:
> I need to be able to do cross products and multiply matrices in a
> compatible way. How can I do this? i.e. is there a way to do cross
> products without loading the vect package or a way to get around the
> vect package messing up dot?
I went back through the mailing list archive and the most recent
discussion I found was from Sept 2006. I proposed (and now I'll
repeat the proposal) that a new operator, named "dot" or something
else, be defined in vect.mac to represent the scalar product.
A proposal was made by Stavros (as quoted below) to rework the
simplification of "." so that it becomes commutative when
appropriate, namely when the arguments are 1 x n or n x 1 matrices
or vectors or lists.
I guess on reconsidering the proposal to rework "." I am still in
favor of creating a new operator. I'm uncomfortable with a
noncommutative operator which is sometimes commutative.
On a slight tangent, I would like to make it possible to apply the
scalar product operator to other objects such as functions.
I think it is possible to allow for different kinds of arguments
by defining different simplification rules or by making a function
which tests the argument types. Either approach has
its drawbacks.
Let's try to figure out what to do so that we don't find ourselves
revisiting this again in a couple of months ....
Robert
-------------------------- begin quoted message --------------------------
Stavros Macrakis macrakis
Wed Sep 6 12:07:57 CDT 2006
Well, the underlying problem here is that the dot product really is
the same thing as the matrix product -- in fact, Maxima is happy to do
[a,b].[c,d] => a*c+b*d (with implicit interpretation of list as matrix
and implicit transpose).
For general matrices, this product is non-commutative; but for the
column/row case, it is commutative.
The vector package currently requires the user to declare vector
variables as "nonscalar". But nonscalar subsumes matrices as well as
vectors. It should require some more specific declaration of vector
variables as vectors. If we require declaring them *both* as vector
and as non-scalar, then very little code needs to be modified -- only
simp-mnctimes needs to know about the commutativity of vector product.
Am I missing something?
-s