2
$\begingroup$

I'm using this site to play with quaternions. All of my quaternions are unit quaternions.

I find quaternion of some Euler Angles(x, y, z) by using the website -inputs are degree and ZYX order Euler- and then by inputting the conjugate of the founded quaternion, I expect to see Conjugate of my Euler Angles (-x, -y, -z)

My flow is:

Euler(Input) => Quaternion(Result) => Conjugate of the Quaternion(Input) 
=> Euler Conjugate (Which is original Euler multiplied by -1)(Result)

In Degree and ZYX format, I input values

x = 70
y = 30
z = 0

And resulting quaternion is

[x, y, z, w(scalar)]
[ 0.5540323, 0.2120121, -0.1484525, 0.7912401 ]

When I input conjugate of this quaternion, which is vector parts multiplied by -1:

[ -0.5540323, -0.2120121, 0.1484525, 0.7912401 ]

Resulting Euler angles as (Z Y X) are:

[ x: -72.5047593, y: -9.8465479, z: 28.4812339 ]

Which is not related to my first angles (70, 30, 0). Shouldn't the conjugate of a quaternion give results of Euler angles multiplied by -1, (-70, -30, 0)

I tested the result of (-70, -30, 0) degrees and the resulting quaternion is

[ -0.5540323, -0.2120121, -0.1484525, 0.7912401 ]

Which has x and y components multiplied by -1, but z component is preserved. What is the point I'm missing in this problem?

$\endgroup$

1 Answer 1

3
$\begingroup$

You're missing two things. First, the conjugate quaternion should give you the inverse rotation, that is, a rotation that undoes your original Euler-angle rotation. The inverse rotation is not obtained just by changing the signs of the Euler angles. You can invert a rotation by reversing the rotation around each individual axis, but only if you apply it to the axes in reverse order. Merely changing the three angles in your set of Euler angles, you are claiming you can apply the rotations to the axes in the same order as before, which does not work in general.

Second, Euler-angle representations are not unique. You could input a set of angles, get a quaternion, and then try converting that quaternion back to Euler angles; you are not guaranteed to get the same Euler angles back even in that case, where you are dealing with only one rotation. For example, this answer deals with one particular interpretation of Euler angles and one particular set of conversion functions to and from quaternions, where the second set of Euler angles will be different from the first if the $y$-axis rotation in the original Euler angles was greater than a right angle.

$\endgroup$
2
  • $\begingroup$ Okey I got the point on Conjugate topic. So if my order is Yaw-Pitch-Roll, I should go as Roll-Pitch-Yaw order to reverse. So "Order issue" might the key to the answer to my problem here ? math.stackexchange.com/questions/3728738/… $\endgroup$ Jun 28, 2020 at 16:49
  • $\begingroup$ If you switch yaw-pitch-roll to roll-pitch-yaw, and you are completely consistent about it, negating the angles gives you the inverse rotation. But beware: you can't give the new set of Euler angles to any function that expected a set of roll-pitch-yaw angles, including your conversion-to-quaternions function and probably any graphics functions that you are using that take Euler-angle inputs. So it seems to me this technique is not useful for your application. $\endgroup$
    – David K
    Jun 28, 2020 at 16:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .