\( \newcommand{\P}[]{\unicode{xB6}} \newcommand{\AA}[]{\unicode{x212B}} \newcommand{\empty}[]{\emptyset} \newcommand{\O}[]{\emptyset} \newcommand{\Alpha}[]{Α} \newcommand{\Beta}[]{Β} \newcommand{\Epsilon}[]{Ε} \newcommand{\Iota}[]{Ι} \newcommand{\Kappa}[]{Κ} \newcommand{\Rho}[]{Ρ} \newcommand{\Tau}[]{Τ} \newcommand{\Zeta}[]{Ζ} \newcommand{\Mu}[]{\unicode{x039C}} \newcommand{\Chi}[]{Χ} \newcommand{\Eta}[]{\unicode{x0397}} \newcommand{\Nu}[]{\unicode{x039D}} \newcommand{\Omicron}[]{\unicode{x039F}} \DeclareMathOperator{\sgn}{sgn} \def\oiint{\mathop{\vcenter{\mathchoice{\huge\unicode{x222F}\,}{\unicode{x222F}}{\unicode{x222F}}{\unicode{x222F}}}\,}\nolimits} \def\oiiint{\mathop{\vcenter{\mathchoice{\huge\unicode{x2230}\,}{\unicode{x2230}}{\unicode{x2230}}{\unicode{x2230}}}\,}\nolimits} \)

This article is about rotations in 3D space.

Representations

The most natural representation of rotations are Quaternions. However rotations can also be represented in various other forms.

See https://www.andre-gaschler.com/rotationconverter/ to convert between representations

Angle Axis

Also known as axis-angle

Rotation Vector

Euler Angles

Quaternion

See Quaternion.

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

This section is on converting between different forms of rotations.
How to construct a rotation.
See http://www.euclideanspace.com/maths/geometry/rotations/conversions/index.htm for a list of conversions.

Angle Axis to Matrix

Apply Wikipedia: Rodrigues' rotation formula

Suppose \(\mathbf{k}=(k_x, k_y, k_z)\) is the vector around which you want to rotate.
Let \[ \mathbf{K} = [\mathbf{k}]_\times = \begin{pmatrix} 0 & -k_z & k_y\\ k_z & 0 & -k_x\\ -k_y & k_x & 0 \end{pmatrix} \] Then our rotation matrix is: \[ \begin{equation} \mathbf{R} = \mathbf{I} + (\sin\theta)\mathbf{K} + (1-\cos\theta)\mathbf{K}^2 \end{equation} \]

Angle Axis to Quaternion

Based on 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

References