Rotations: Difference between revisions
Created page with " This article is about rotations in 3D space. ==Representations== The most natural representation of rotations are Quaternions. However rotations can also be represented in v..." |
No edit summary |
||
(7 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
The most natural representation of rotations are Quaternions. | The most natural representation of rotations are Quaternions. | ||
However rotations can also be represented in various other forms. | However rotations can also be represented in various other forms. | ||
See https://www.andre-gaschler.com/rotationconverter/ to convert between representations | |||
===Angle Axis=== | ===Angle Axis=== | ||
Also known as axis-angle | |||
===Rotation Vector=== | ===Rotation Vector=== | ||
===Euler Angles=== | ===Euler Angles=== | ||
===Quaternion=== | ===Quaternion=== | ||
See [[Quaternion]]. | |||
===Matrix=== | ===Matrix=== | ||
A \(3\times 3\) matrix is the most convenient form of a rotation since applying the rotation to a vector is simply a matrix multiplication. | |||
==Construction | ==Construction== | ||
This section is on converting between different forms of rotations.<br> | This section is on converting between different forms of rotations.<br> | ||
How to construct a rotation.<br> | How to construct a rotation.<br> | ||
See [http://www.euclideanspace.com/maths/geometry/rotations/conversions/index.htm http://www.euclideanspace.com/maths/geometry/rotations/conversions/index.htm] for a list of conversions. | |||
===Angle Axis to Matrix=== | ===Angle Axis to Matrix=== | ||
Line 22: | Line 32: | ||
Let | Let | ||
\[ | \[ | ||
\mathbf{K} = [\mathbf{k}]_\times | \mathbf{K} = [\mathbf{k}]_\times = | ||
\begin{pmatrix} | \begin{pmatrix} | ||
0 & -k_z & k_y\\ | 0 & -k_z & k_y\\ | ||
Line 35: | Line 45: | ||
\end{equation} | \end{equation} | ||
\] | \] | ||
===Angle Axis to Quaternion=== | |||
Based on [http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm] | |||
\[ | |||
\begin{align} | |||
q_x &= k_x * \sin(\theta/2)\\ | |||
q_y &= k_y * \sin(\theta/2)\\ | |||
q_z &= k_z * \sin(\theta/2)\\ | |||
q_w &= \cos(\theta/2) | |||
\end{align} | |||
\] | |||
==Resources== | ==Resources== | ||
* [https://docs.unity3d.com/ScriptReference/Quaternion.html Unity Quaternion Script Reference] | * [https://docs.unity3d.com/ScriptReference/Quaternion.html Unity Quaternion Script Reference] | ||
* [https://threejs.org/docs/#api/en/math/Quaternion three.js Quaternion] | * [https://threejs.org/docs/#api/en/math/Quaternion three.js Quaternion] | ||
** [https://github.com/mrdoob/three.js/blob/master/src/math/Quaternion.js three.js/Quaternion.js source code] | |||
* [https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.transform.Rotation.html scipy.spatial.transform.Rotation] | * [https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.transform.Rotation.html scipy.spatial.transform.Rotation] | ||
==References== | ==References== |