[Math] Difference between two quaternions

linear algebraquaternions

I am currently writing up a program that needs to know the difference in degrees for each axis between two quaternions.

Now, suppose I have a starting quaternion Qs and I need to compute at each step the difference between my current orientation represented by the quaternion Qc.
I do that: Q = Qc^-1 * Qs

Now I would like to get values from the quaternion Q that would represent for each axis the number of degrees that differ from Qc to Qs. Is that possible?

Edit: If that's not clear here are other explanations
I know I can get the angle value from a quaternion by doing 2 * cos-1(q.w). Now I would like to get an idea on how to project this angle onto each axis. The expected output is something like:

From Qs to Qc there is a rotation of 30 degrees on the x axis, 20 degrees on the y axis and 0 degrees on the z axis

Best Answer

It sounds like you are just looking for a way to convert your quaternion $Q$ to Euler angles, and there are numerous webpages on the internet that cover this very well already. Just google "quaternions to Euler angles" and you get things like these:

http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/

https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles

http://www.chrobotics.com/library/understanding-quaternions