如何将四元数转换为角度? [英] How to convert quaternion to angle?

查看:617
本文介绍了如何将四元数转换为角度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在将四元数转换为角度的公式?

Is there a formula to convert a quaternion to an angle?

希望使用Core Motion API和陀螺仪在iPhone上执行某些操作,以便基于我从中接收到的数据(以四元数的形式)可以在屏幕上投影UIView.

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.

谢谢

推荐答案

是的,请参见四元数和空间旋转.四元数单位(w,x,y,z)表示绕轴(x,y,z)旋转2 * cos -1 (w)的角度.

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).

请注意,这仅适用于 unit 四元数.非单位四元数不代表旋转.

Note that this is only true of unit quaternions. Non-unit quaternions do not represent rotations.

这篇关于如何将四元数转换为角度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆