Take the 2-minute tour ×
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.

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|improve this question

migrated from stackoverflow.com 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: math.stackexchange.com/questions/90081/quaternion-distance –  user111777 Nov 27 '13 at 5:41

1 Answer 1

up vote 2 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 = \arccos(z_0)$. Then $\theta$ gives you an angle by which the two quaternions differ. This is not quite matlab code but it is easy to implement.

share|improve this answer
    
why is the difference is x*conj(y). can you please explain.? –  sat Jan 28 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 at 0:33

Your Answer

 
discard

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.