ryan88 said:
I have been looking at quaternions to perform rotations, however I have come across two slightly different equations to do this:
v' = q^{-1}vq
v' = qvq^{-1}
What is the difference between these two?
Semantics, nothing else.
A very similar issue arises with similarity transformations. Should they be written as PAP^{-1} (e.g.
http://mathworld.wolfram.com/SimilarityTransformation.html) or P^{-1}AP (e.g.,
http://en.wikipedia.org/wiki/Similar_matrix)? The answer is "yes". The same applies to quaternions when used to represent rotations.
In other words, there is no right way / wrong way. What is wrong is arguing that one way is right, the other wrong. One way
is right, but the other way isn't wrong. It's left. I (and others) call the quaternion q in the form v'=qvq^{-1} a "left" quaternion while the form v'=q^{-1}vq uses a "right" quaternion. Is the original quaternion is on the left or the right?
There are subtle differences in the representation. The equation that relates the time derivative of the quaternion to angular velocity takes on a slightly different form for left and right quaternions, and how quaternions for multiple reference frames chain also differs.
With regard to the latter, suppose you have three frames of interest denoted A, B, and C. Suppose you also know the quaternion q_{A\to B} that transform a vector from frame A to frame B, and you know the quaternion q_{B\to C} that transform a vector from frame B to frame C. Finally, suppose that you do not know, but need to know, the quaternion q_{A\to C} that transforms a vector from frame A to frame C. It's an easy computation. With left quaternions, q_{A\to C} = q_{B\to C}q_{A\to B}. Left quaternions chain from right to left. This is exactly how transformation matrices chain. With right quaternions, q_{A\to C} = q_{A\to B}q_{B\to C}. This is analogous to how vectors chain, end to end.
One last issue occurs when two organizations that uses quaternions need to exchange data. Someone had better beware of this left versus right ambiguity. Tempers will flare otherwise! I've seen this silliness firsthand.