3D Rotation Representations
Euler-angles
3D rotations can be represented by a sequence of 2D rotations about each axis respectively. Typically, the order is
Gimbal Lock
When two axes become aligned, applying a rotation around these axes is equivalent to each other, resulting in degree of freedom loss.
Suppose we have
Rotation Matrices
A matrix
With the above constraints, a rotation matrix has actually 3 degrees of freedom.
We can also combine the rotation matrix
When applying this to a vector, note that this vector should be in homogeneous coordinates.
Axis-angles
According to Euler's rotation theorem, any 3D rotation can be specified using two parameters: a unit vector
Vector Notation
Decompose
where
We have
Building orthogonal basis using
Matrix Notation
where
Exponential Notation
If
Therefore, if
Using Taylor's series for
which is the same as the formula in matrix notation.
Quaternions
Quaternions are generalized complex numbers of the form:
where
Quaternion products are not reflexible, i.e.
A quaternion can also be represented as a scalar with a 3D vector:
where
Quaternion Product
The product of two quaternions is
Rotation Quaternions
A quaternion can also be used to represent a rotation:
Rotation of vector
where
Quaternion products are equivalent to Rodrigue's formula.
From the definition of quaternion product,
We also know that
Therefore
Double Cover Issue
Quaternions have double cover issue that
Dual Quaternions
A dual quaternion has the form
where
- The addition of two dual quaternions is component-wise.
- The multiplication of two dual quaternions satisfies
6D Rotation Representation
Also see On the Continuity of Rotation Representations in Neural Networks.
Represent a 3D rotation with two 3D vectors
Conversion Between Representations
From Euler-angles to Rotation Matrices
Given Euler-angles
The resulting rotation matrix is
From Rotation Matrices to Quaternions
Given a rotation matrix
we want to compute the quaternion
First compute
If
If
If
If
If
From Quaternions and Translations to Dual Quaternions
Given a quaternion
The dual part is calculated via quaternion multiplication
The resulting dual quaternion is
From 6D Representations to Rotation Matrices
Given 3D vectors
where
Summary
Methods | Descriptions | Pros | Cons |
---|---|---|---|
Euler-angles | Use rotation angles about three principle axes to represent a rotation | - Intuitive to represent - Use only three parameters |
- Gimbal lock: one degree of freedom is lost if two of the three rotational axes align - Hard and unintuitive to interpolate - Do not commute under composition - Non-uniqueness: infinite number of angle choices for a rotation |
Rotation Matrices | Use a |
- Trivial to compute and apply - Easy to combine two rotations - Can represent rotation and translation in one matrix |
- Redundancy in parameters - Normalization required - Hard to interpolate - Hard to visualize |
Axis-angles | Use a unit axis |
- Straightforward | - Non-uniqueness: infinite number of angle choices for a rotation - Hard to interpolate |
Quaternions | Encode the axis-angle into a quaternion |
- Provide direct ways for smooth interpolation - Use only four parameters |
- Unintuitive to understand - Combining rotations requires non-linear operations |
Dual Quaternions | Use two quaternions to represent both rotation and translation | - Unify rotation and translation into a single framework - Lower computational cost than using matrices - Require fewer parameters than matrices - Easy to concatenate transforms |
- Unintuitive to understand - Not widely adopted |