问题
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
回答1:
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.
来源:https://stackoverflow.com/questions/3825571/how-to-convert-quaternion-to-angle