1

I have 2 matrices. Matrix A and Matrix B which is a 'matrix A rotated by some angle around some axis' (quaternion?). So: B = A.Transform (quaternion).
now when I know B and A, and maybe axis, how do I find the angle of that quaternion?

Sorry for bad text, I'm on a German keyboard and I'm not German...

2
  • For your keyboard, have you tried using Alt+Space? That will switch your keyboard to another language layout. Commented Apr 7, 2014 at 21:29
  • I did. But still some mappings are incorrect. Commented Apr 8, 2014 at 10:10

1 Answer 1

3

So you have B = A x T

therefore A-1 x B = T

So take the matrix inverse of A and multiply that by B to get the Transform matrix.

Then extract the quaternion, (or Euler angles, if you would prefer), using say http://www.cg.info.hiroshima-cu.ac.jp/~miyazaki/knowledge/teche52.html

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, you saved my life. I converted result to System.Windows.Media.Media3D Qiaternion. Now I read Angle property from object. But I'm not sure, it will give me angle in range 0..180deg or 0..360deg?
I'm not sure either, but you can fix it up, e.g. angle = angle < 0.0 ? angle + 360 : angle; // to make it > 0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.