# quaternion and rotation matrix

## Recommended Posts

I was reading some codes and somehow it confused me.. Some codes set quaternion as q = (axis.x, axis.y, axis.z, cos(t/2)) and Some other ones set as q = (cos(t/2), sin(t/2)*axis). I know that definition of quaternion has 2nd form I just listed, that w is cos of half angle and x, y, z should be multiplied the sin of half angle... But why would the first form work?? Also I saw making quaternion into a matrix, matrix can be 2 forms by changing the sign of the calculation that are not on the identity elements. That is m =| a x x 0 | | x b x 0 | | x x c 0 | | 0 0 0 1 | where x's are have 2 different ways of calculation. (either 2xy+2wz or 2xy-2wz). Why is this so?? please help me! thx~~

##### Share on other sites
Sounds like the first form is wrong, unless they're assuming that the axis is already pre-scaled. Even if you normalized it, it still wouldn't give you the right result. It could be that they're doing something unusual with it; I'd have to see the code.

There are two different forms of rotation matrix because you can either have a rotation matrix for column vectors or a rotation matrix for row vectors. They're transposes of each other.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628305
• Total Posts
2981962

• 9
• 12
• 11
• 12
• 11