Is the result of combining two quaternion rotations the same as that of two matrices and then converting that into a quaternion?
I have a quaternion (q1) and rotation matrix (m2) as input for a function (unfortunately non-negotiable) and would like to rotate the initial quaternion by the matrix resulting in a new quaternion. I have tried a fair few ways of doing this and have slightly bizarre results.
If I convert q1 into a matrix (m1), calculate m2.m1 and convert the result into a quaternion I get what is a likely quaternion result. However if I convert m2 into a quaternion using the exact same function and multiply those together (in both orders, I know it's non-commutative) I get something entirely different. I would like to realise the quaternion combination so that I can eventually SLERP from the current quaternion to the result.
All functions have come from here: http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm and are being implemented in c++ and mathematica to test