Ask Your Question

uutzinger's profile - activity

2015-07-31 03:33:17 +0200 asked a question How do I multiply quaternion and vector?

I started with this

N.<c,d,a1,a2,a3,a4,b1,b2,b3,b4,s> = QQ[]
H.<i,j,k> = QuaternionAlgebra(c,d)
a = a1 + a2 * i + a3 * j + a4 * k
b = b1 + b2 * i + b3 * j + b4 * k
a+b
a*b

but the next step does not work

gravity = vector([0, 0, 1])
a * gravity * a.conjugate()
2015-07-31 03:24:53 +0200 received badge  Editor (source)
2015-07-31 03:24:24 +0200 answered a question How to do symbolic computation with quaternions
N.<c,d,a1,a2,a3,a4,b1,b2,b3,b4,s> = QQ[]
H.<i,j,k> = QuaternionAlgebra(c,d)
a = a1 + a2 * i + a3 * j + a4 * k
b = b1 + b2 * i + b3 * j + b4 * k
a+b
a*b

From http://www.wstein.org/edu/2010/414/pr...

Seems to give better results

Now I just need to figure out how to define vector and rotate it with quaternion.