# More notation?!

7 views

### svda...@gmail.com

Sep 6, 2021, 1:09:13 PMSep 6
to Numbas Users
Hi all,

Anyone know a good way to include scalar and vector products in a mathematical expression answer?

E.g. if I am asking about the acceleration of a charged particle moving in a magnetic field, the answer might be (q/m)*(vec:v x vec:B) where 'x' is a cross/vector product.

I've seen plenty of examples for evaluating the components of a vector product, or the value of a scale product. Just none where the answer is expressed as a product.

[cross(vec:v, vec:B) is a valid JME expression. But this is not a valid mathematical expression for a gap fill answer.]

Cheers,

Simon

### Christian Lawson-Perfect

Sep 7, 2021, 8:09:10 AMSep 7
Can you explain what you mean by "this is not a valid mathematical expression for a gap fill answer"?
I've just made a question with a mathematical expression part whose answer is "cross(vec:a, vec:b)", and it looks like it works fine: https://numbas.mathcentre.ac.uk/question/share/view/8f3c0c1b-f5f8-4ce4-b3ea-db9e81c60e8f

--
You received this message because you are subscribed to the Google Groups "Numbas Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numbas-users...@googlegroups.com.

### Simon Vaughan

Sep 7, 2021, 12:21:31 PMSep 7
HI Christian,

Thanks. Ok, that worked easier than I thought.

I had previously tried dot( , ) and cross( , ) in a gap fill just to see if they parsed. E.g. I put 'dot(vec:a, vec:b)' or cross(vec:a, vec:b)' into a box expecting 'x^2' and got the error 'Your answer is not a valid mathematical expression. No definition of 'dot' of correct type found..'. As it was marked invalid, not incorrect, I assumed there must be another convention to use. Something about setting the answer to include a cross( , ) or dot( , ) must ensure these get recognised.

Cheers,

Simon

--
Cheers,

Simon