Euler angle equivalents of Quaternion distance

90 Views Asked by At

I have been using 2*acos(q.w) as a measure of the angle X between quaternions were q.w is the scalar part of the difference quaternion between them. This matches experiment precisely using inertial sensors.

I recently learned that Euler angles can also be used to give the same angle X by 2 means:

  1. Express q.w as Euler angles see https://en.m.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles and substitute in 2*acos(q.w) giving X=2*acos(cos(r/2)cos(p/2)cos(h/2)+sin(r/2)sin(p/2)sin(h/2))

  2. Use pythagoras: X=Sqrt(r^2+p^2+h^2)

(Where r,p,h are Euler angles roll, pitch, heading)

I can understand the derivation in 1. but not 2.

Can anyone provide proof that 1. And 2. Are the same or at least explain how they are giving near identical experimental results?