Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Division of two vectors is only allowed if they are a scalar multiple of each other, and the result is the ratio of their length. If not, you get an error:

sage: vector(QQ, [1,2,3]) / vector(QQ, [2,4,6])
1/2
sage: vector(QQ, [1,2,3]) / vector(QQ, [1,1,1])
Traceback (most recent call last)
...
ArithmeticError: vector is not in free module

The ratio is in the same base ring as the vectors, so if you have vectors over QQ then the ratio is rational, if you have vectors over SR then the ratio is again an element of the symbolic ring.