iOS旋转矩阵的解释 [英] explanation of iOS rotation matrix

查看:252
本文介绍了iOS旋转矩阵的解释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用3D旋转,但我似乎不知道框架如何进行计算。

I am trying to work with 3D rotations but I don't seem to get the idea how the framework does the calculations.

例如,我得到这些数据:

For example I get this data:

yaw -1.010544 pitch 0.508249 roll 1.128918

yaw -1.010544 pitch 0.508249 roll 1.128918

然后我打印相应的旋转矩阵

Then I print the corresponding rotation matrix


  • 0.599901 -0.128495 -0.789689

  • 0.740043 0.464230 0.486649

  • 0.304065 -0.876344 0.373584

在阅读了API和wiki之后,我非常确定必须有一种通用的方法来创建一个超出欧拉角度的旋转矩阵。我尝试了所有这些这里,没有结果。

After reading the API and the wiki, I am pretty sure there must be a general way to create a rotationmatrix out of euler angles. I tried all of these here, no results.

我错过了什么,或者这是怎么做的?

Do I miss something, or how is this done?

推荐答案

好吧,iOS或CoreMotion都提供了这两种功能。 RotationMatrix和Euler角度表示。
文档这里

Well, iOS or CoreMotion provides both. RotationMatrix and Euler Angle Representation. The documentation is here.

但如果您对此计算的工作原理感兴趣,请查看这里
总结:每个欧拉角可以用旋转矩阵表示,该旋转矩阵描述围绕一个单位轴的旋转。由于有三个角度,你只需要将它们组合起来。但要小心!欧拉角不是明确的,因为旋转矩阵可以乘以不同的顺序。

But if you are interested how this calculation works, the take a look here. To sum it up: Each Euler Angle can be represented by a rotation matrix which describes a rotation around one unit axis. Since there are three angles, you just have to combine them. But watch out! Euler angles are not unambiguous since there are different orders in which the rotation matrices can be multiplied.

编辑:您链接到四元数计算。或者我完全错了?

You linked to a quaternion calculation. Or am I completely wrong?

这篇关于iOS旋转矩阵的解释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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