# Thread: How do I do vector product / scalar product using maxima?

1. ## How do I do vector product / scalar product using maxima?

What I want, basically, is something like [2,3]*[4,7] = 29.

Any input would be GREATLY appreciated!

2. Originally Posted by s3a
What I want, basically, is something like [2,3]*[4,7] = 29.

Any input would be GREATLY appreciated!
Search the help system for "dot product"

CB

3. I did that before starting this thread. I do not understand what it says though.

4. What is so difficult?

Dot Product

The operator . represents noncommutative multiplication and scalar product. When the operands are 1-column or 1-row matrices a and b, the expression a.b is equivalent to sum (a[i]*b[i], i, 1, length(a)). If a and b are not complex, this is the scalar product, also called the inner product or dot product, of a and b. The scalar product is defined as conjugate(a).b when a and b are complex; innerproduct in the eigen package provides the complex scalar product.

When the operands are more general matrices, the product is the matrix product a and b. The number of rows of b must equal the number of columns of a, and the result has number of rows equal to the number of rows of a and number of columns equal to the number of columns of b.

To distinguish . as an arithmetic operator from the decimal point in a floating point number, it may be necessary to leave spaces on either side. For example, 5.e3 is 5000.0 but 5 . e3 is 5 times e3.

There are several flags which govern the simplification of expressions involving ., namely dot, dot0nscsimp, dot0simp, dot1simp, dotassoc, dotconstrules, dotdistrib, dotexptsimp, dotident, and dotscrules.

5. I still don't get the maxima documentation but I get what you said. But for the maxima documentation, is "There are several flags which govern the simplification of expressions involving ., namely dot, dot0nscsimp, dot0simp, dot1simp, dotassoc, dotconstrules, dotdistrib, dotexptsimp, dotident, and dotscrules." supposed to be the instructions? If so, then why do they use words instead of actual examples?

6. Originally Posted by s3a
I still don't get the maxima documentation but I get what you said.
Have you ever considered that you may not be read for this topic?
$\displaystyle <a,b>\cdot<x,y>=ax+by$ and $\displaystyle <a,b,c>\cdot<x,y,z>=ax+by+cz$
Nothing can be simpler. What is your problem?

7. Originally Posted by s3a
I still don't get the maxima documentation but I get what you said. But for the maxima documentation, is "There are several flags which govern the simplification of expressions involving ., namely dot, dot0nscsimp, dot0simp, dot1simp, dotassoc, dotconstrules, dotdistrib, dotexptsimp, dotident, and dotscrules." supposed to be the instructions? If so, then why do they use words instead of actual examples?
Each of these flags has their own enry in the help system, which you can read if you want, but they are not applicable in general to scalar products but to the use of "," as the matrix multiplication operator.

CB