Closed ChristopherChudzicki closed 6 years ago
One idea to reduce the confusion is to disallow expressions like i*i*j
all together: Parser.eval_product
could raise an error if three of its children are vectors. The error might say something like "Multiplication of three vectors without parentheses is ambiguous. Please add parentheses around dot products."
Ah. Good catch. We don't usually run into this problem on paper because we have different symbols for dot produt vs normal multiplication. I agree that this is ambiguous. I see two options:
Given that multiplication is rendered as a dot product, I don't really like the second... Let's go with warning that an ambiguous product was detected.
Since
*
multiplies vectors as a dot product,*
is not associative when used with vectors.This seems like it could cause confusion, especially since edX renders multiplication with dot product symbols.
Edit: In particular, students might not know above whether
i*i*j
is equivalent to(i*i)*j
ori*(i*j)
.