Why do Quaternions have four variables?

非 Y 不嫁゛ 提交于 2021-01-27 13:55:33

问题


The official documentation for the Unity Engine doesn't contain this, and I'm not far enough into my math/physics studies to have come across a Quaternion, but I understand it has to do with rotation. What I don't understand is why Quaternions have four variables, w,x,y,z, when there are only three axis of rotation in Unity.


回答1:


"A quaternion is basically an axis in 3D space with a angle of rotation around the axis. Four values make up a quaternion, namely x, y, z and w. Three of the values are used to represent the axis in vector format, and the forth value would be the angle of rotation around the axis."

http://www.real3dtutorials.com/tut00011.php

So you could think of it as the rotation of the rotation, in simple terms!

Like Hellium noted in the comments below; Unity recommends that you do not fiddle with Quaternions directly if don't know exactly what you're doing. Like Hellium also points out, whatever you want to accomplish, you probably want to use the static methods of the Quaternion class. They are very useful and easy to use and can accomplish most things you want to do with rotations.



来源:https://stackoverflow.com/questions/42285413/why-do-quaternions-have-four-variables

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