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!


1 Answer 1


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.

  • 1
    $\begingroup$ why is the difference is x*conj(y). can you please explain.? $\endgroup$
    – sat
    Jan 28, 2014 at 14:43
  • 2
    $\begingroup$ @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. $\endgroup$
    – Tpofofn
    Jan 29, 2014 at 0:33
  • $\begingroup$ Shouldn't the formula be $\theta=2 \arccos(\mid z_0 \mid)$? Otherwise you can get angles that are close to $360^{\circ}$, which doesn't make much sense. $\endgroup$
    – user502144
    Nov 6, 2018 at 10:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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