Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on a project where I have many quaternion attitude vectors, and I want to find the 'precision' of these quaternions with respect to each-other.

Without being an expert in this type of thing, my first thought is to find the angle between each (normalized) quaternion, and then find the RMS of that angle. That will give a measure of the precision of our attitude measurements. I was going to use a simple dot product to get this angle.

I don't know that this is a good solution though. Don't know if the dot product will necessarily work between quaternions though.

Note that just want a scalar representation of the pointing precision, and that the differences will on the order of arcseconds. I had also thought to convert to Euler Angles and then just use the vector part of that the Euler Angles.

Doing the math in MATLAB, but really I'm just looking for the theory behind it.

Thanks for the help!

share|cite|improve this question

migrated from Jul 7 '12 at 12:56

This question came from our site for professional and enthusiast programmers.

I had better success with the logic here: – user111777 Nov 27 '13 at 5:41
up vote 4 down vote accepted

For small differences the Euclidian distance between the two vectors is sufficient. To get an exact answer you would have to use the following process. Assume your quaternions $x$ and $y$ are represented as $x = [x_0, x_1, x_2, x_3]$ and $y = [y_0, y_1, y_2, y_3]$ and that they are unit quaternions. Then let $\operatorname{inv}()$ denote the inverse of a quaternion which for unit quaternions is equivalent to the conjugate (i.e. $ \operatorname{inv}(x)=\operatorname{conj}(x) = [x_0, -x_1, -x_2, -x_3]$). Then the quantity that captures the true difference is $z = x*\operatorname{conj}(y)$. We can then recover the angle using $\theta = 2\arccos(z_0)$. Then $\theta$ gives you an angle by which the two quaternions differ.

share|cite|improve this answer
why is the difference is x*conj(y). can you please explain.? – sat Jan 28 '14 at 14:43
@sat, it is because each quaternion represents a rotation with respect to the same frame of reference. What we are interested in is a rotation from one quaternion to the other, so we need to find a composition of the two quaternions by transforming backward along one (i.e. inverse or conjugate) and then transforming forward along the other. That is the way to take the "difference" for rotations. I hope this helps. – Tpofofn Jan 29 '14 at 0:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.