Rotation and Orientation
What is Rotation?
Rotation is very nonintuitive;
In geometry, rotation is a movement that keeps at least one point fixed.
But in physics, rotation is extremely complex!
Intermediate axis theorem: Rotation around major and minor axis is stable, but rotation around intermediate axis is unstable!
The rotation axis keeps chaning, and the object can even be flipped!
Orientation vs. Rotation
Orientation is the state of being oriented.
Given a coordinate system, the orientation of an object can be represented as a rotation relative to a reference pose (similar to origin)
Rotation is a circular movement.
2D Orientation
Just use angle, right?
Problem: Object has same orientation if it makes a full turn.
e.g. What is the middle orientation between and ?
We can't just average the numbers!
Solution: Add extra parameters and constraints.
We represent 2D rotation as a complex number , but it's constrained to the unit circle .
Multiplying rotation is equal to a composition of rotation!!
In fact, it's actually .
2D Rotation
We can't use complex number for rotation;
We have to distinguish between 1 full turn and 2 full turns.
We'll just use angle to represent 2D rotations. (as we've been doing)
Unlike point and vectors, we have to choose different representation for rotation and orientation.
3D Rotation
Euler's rotation theorem: The general displacement of a rigid body with one point fixed is a rotation about some axis.
i.e. any 3D rotation can be represented as a one rotation around an axis.
- Axis-angle: Use 4 parameters.
- Rotation vector: Use only 3 parameters!
Vector's direction represents axis, and vector's magnitude represents angle.
Rotation vector is better!
3D Orientation
Euler parameters
Euler angle has gimbal lock problem.
We can use 4 parameters to solve gimbal lock problem,
where is rotation angle and is rotation axis.
But how do we use this?
Quaternions
where
c.f. Trinion(?) can't exist! It's proven that you can't define multiplication in tirion.
We can represent quaternions as a scalar and a vector!
Rotation as Unit Quaternion
We use unit quaternions, i.e. .
We use euler parameters as a quaternion. Rotating along axis is represented as .
We represent 3D vectors as a pure imaginary Quaternions .
Then rotating vector about rotation is represented as .
Antipodal Equivalence
and represents same rotation.
Mathmatically saying, this is a 2-to-1 mapping between (surface of unit sphere in 4D space) and SO(3).
That's why we have to use instead of !
Why not use rotation matrix?
Every representation have a conversion between two.
But it's challenging due to differences in conventions.
Unit quaternion is the most efficient method!
It's very similar to rotation matrix, and has fewer paramers.
Also, normalizing matrix is very hard (Gram-Schmidt Process), while normalizing quaternion is easy.
e.g. Quaternion to Rotation matrix
Tangent Vector
Tangent space of a point on is three-dimensional space of quaternions, .
If a point is given, we apply and use tangent space . ()
Every vector in is purely imaginary quaternion - i.e. real part should be 0 such as (0, x, y, z).
We call tangent vector is a vector from I to the projection of onto .
isn't related to velocity, but it is related to angular velocity.
Exp and Log
We define log as a map from to , and exp as a map from to to .
i.e. log is a map from to , following the shortest path on the sphere, a.k.a. the great arc.
Exp maps 3D vector (in form of purely imaginary quaternion) to quaternion.
i.e. it maps 3D rotation vector to a corresponding rotation quaternion.
Note that rotation quaternion of rotation vector is !!!
Rotation Vector
Let's say if you rotate orientation by the rotation vector , you get orientaiton . i.e. .
If we apply , rotation vector is a rotation from to .
Therefore, is a projection of , i.e.
Now we get rotation quaternion from to is .
i.e. .
Finite rotation
e.g. Angular displacement
We can't just add rotation vectors in 3D!
Infinitesimal rotation
e.g. Instantaneous angular velocity
Addition of angular velocity is possible.
Spherical Linear Interpolation (SLERP)
Linear interpolation of two orientations!
We interpolate great arc between two orientations.
Regarding radians, we can think of this as an interpolation of angle.
Unlike interpolating with Euler angles or rotation vectors, slerp interpolates along the shortest route (i.e. straight line path).
Coordinate-Invariant Operations
- orientation is quaternion representing orientation.
- exp of rotation vector is quaternion representing rotation.
- is quaternion representing rotation.
- power of quaternion representing rotation is well defined.
- power of quaternion representing orientation is only defined when power is 0 or 1.
Adding rotation vectors
Quaternion multiplication is non‑commutative.
If we divide rotation into half, it's still non-commutative, but the difference has decreased.
If we divide rotation infinitely, we can swap the rotations!
We define this as the addition of the rotation vectors.
Affine combination of orientations
There are some definitions about affine combination of orientations.
But it's very complex, and each definitions results different orientations.