Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

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

Given multiple quaternions representing orientations, and I want to average them. Each one has a different weight, and they all sum up to one.

How can I get the average of them? Simple multiplication by weights and addition won't work, since it doesn't take into account that (qw, qx, qy, qz) = (-qw, -qx, -qy, -qz)..

share|cite|improve this question
Google gives Someone who knows more may be able to expand. – Peter Taylor Sep 1 '11 at 9:50
up vote 1 down vote accepted

I assume you are thinking of unit quaternions and you are using them to represent rotations? If that is the case then here is a paper on the related subject of means and averages in the rotation group. It might not be a very easy read though if you don't understand the notation.

Barring that, Here's what I might try: Pick a canonical form for your quaternions. Then convert each to the canonical form and finally perform your weighted linear combination.

share|cite|improve this answer

There is a technical report from 2001 which states that the mean is actually quite a good approximation, provided that the quaternions lie close together. (for the case of -q=q, you could just flip the ones that point in the other direction by pre multiplying them by -1, so that all of the quaternions involved life in the same half sphere.

An even better approach is sketched in this paper from 2007, which involves using an SVD.

share|cite|improve this answer
There is a matlab implementation As well as a c++ implementation that both rely on the method of the last paper. For reference, I would also like to point to this discussion on the same topic. – adrelino Oct 20 '14 at 13:04
For further implementation discussion, see this stackoverflow question – adrelino Oct 20 '14 at 13:20

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.