Is there a formula to convert a quaternion to an angle?
Looking to do something on the iPhone using the Core Motion API and the gyro so that based on data I receive from it (in the form of quaternions) I can project a UIView on the screen.
Thanks
Is there a formula to convert a quaternion to an angle?
Looking to do something on the iPhone using the Core Motion API and the gyro so that based on data I receive from it (in the form of quaternions) I can project a UIView on the screen.
Thanks
Yes, see Quaternions and spatial rotation. The unit quaternion (w, x, y, z) represents a rotation about the axis (x, y, z) of an angle of 2*cos-1(w).
Note that this is only true of unit quaternions. Non-unit quaternions do not represent rotations.
You want the angle between a quaternion and what?
A quaternion is like a vector in 4D space.
You can find a angle between two quaternions.