# Relative quaternion

This topic is 4813 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I am looking for the relative rotation quaternion bewteen two orientations. Given: Two unit quaternions q1, q2: Wanted: q_rel Some remarks: (1) The quaternion multiplication is defined in the original form, that is q1 * q2 encodes the rotation q2 followed by q1. E.g. DirectX implements this the other way around in order to stay consistent with the matrix multiplication. (2) The relative orientation should correspond to a relative vector v_rel = v1 - v2. Please note the direction. v_rel points from v2 to v1. What I seek is the relative quaternion q_rel = q1 - q2, though the minus is not correct in this context. What I tried: I seek a rotation that rotates q2 into q1 which I wrote down as: q_rel * q2 = q1 In words: The rotation q2 followed by q_rel equals q1. I then solved this for q_rel what yields: q_rel = q1 * q2.Conjugated(); I can use the conjugate since, since q1 and q2 are both unit quaternion and therefore q.Inverse() == q.Conjugated(). Is this correct? My major concern is the direction. I need the relative rotation with respect to q2 as in the vector example. Best regards, -Dirk

##### Share on other sites
That looks right to me. Then again, it's early and I may not be thinking clearly.

Does it work? Or are you having a problem with it?

##### Share on other sites
It seems to work, but I am not sure. It is late and I am not quite sure if I am thinking correctly as well :)

##### Share on other sites
I noticed you use Inverse = conjugated

For what I know the inverse is the conjugate divided by the length

##### Share on other sites
Quote:
 I noticed you use Inverse = conjugatedFor what I know the inverse is the conjugate divided by the length

Since I use unit quaternions the length is one and therefore the inverse equals the conjugate

1. 1
Rutin
34
2. 2
3. 3
4. 4
5. 5

• 12
• 14
• 9
• 9
• 9
• ### Forum Statistics

• Total Topics
633334
• Total Posts
3011407
• ### Who's Online (See full list)

There are no registered users currently online

×