How to convert quaternion to angle?

Deadly 提交于 2021-01-24 12:12:25

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!