explanation of iOS rotation matrix

三世轮回 提交于 2020-01-01 03:14:14

问题


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

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

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?


回答1:


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.

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



来源:https://stackoverflow.com/questions/10010579/explanation-of-ios-rotation-matrix

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