Lecture_005_3D_Rotation_and_Complex_Representations

2D rotation commute, but 3D rotation does not.

We need 3 degree of freedom for rotation. You can use a vector to denote some rotation (like rotation earth), but you that doesn't cover all rotation. (Although you can do it using two consecutive rotation, but that's no longer 3 degree of freedom)

Euler Angles

Euler Angles: performing rotation separately around 3 axes

Euler Angles: performing rotation separately around 3 axes

Gimbal Lock: in a situration when there is no way to rotate any axis to get desired orientation

Gimbal Lock: in a situration when there is no way to rotate any axis to get desired orientation

Gimbal Lock in Calculation 1

Gimbal Lock in Calculation 1

Gimbal Lock in Calculation 2: adjust klzzwxh:0003 or klzzwxh:0004 only result rotation in one plane

Gimbal Lock in Calculation 2: adjust \theta_x or \theta_z only result rotation in one plane

Imaginary Unit and Complex Number

Imaginary Unit: it is a transformation on an axis by 90 degree counterclockwise in 2D coordinate. We create a new axis when applying klzzwxh:0006 on an existing axis.

Imaginary Unit: it is a transformation on an axis by 90 degree counterclockwise in 2D coordinate. We create a new axis when applying \imath on an existing axis.

Note: I think \imath = \sqrt{-1} is a bull shit since it is not normal algebra. This relation only exists if we defined Complex Multiplication. Solve z in z^2 = \imath

Complex Number: 2D vectors with basis (1, \imath), but instead of using parenthesis, we write it as a + b \imath

Reason for complex number: adding the notion of tuple in a field Example: think about a way to represent a tuple \mathbb{R}^2 within \mathbb{R}.

Complex Multiplication

Complex Multiplication

Complex Multiplication (*): a new operation just like vector dot product and cross product we defined.

Note: Complex Multiplication A * B behaves like linear transformation where A = a + a_i\imath = \langle{a, a_i}\rangle, B = b + b_i\imath = \langle{b, b_i}\rangle. Think A as the transformation where the vector \langle{a, a_i}\rangle is where \hat{i} lands and \hat{j} remain in relation to \hat{i}. (Rotation only)

\begin{align*} z_1 &= (a + b \imath)\\ z_2 &= (c + d \imath)\\ z_1z_2 &= ac + ad\imath + bc\imath + bd\imath^2\\ &= (ac - bd) + (ad + bc)\imath\\ \end{align*}

In above example:

Complex Addition and Subtraction: vector addition and subtraction

Complex Division: reverse Complex Multiplication

Complex Power: multiple Complex Multiplication

Euler's Formula: e^{\imath \theta} = \cos \theta + \imath \sin \theta (this is a mapping from an angle \theta to a unit vector in 2D plane)

// QUESTION: prove (a + bi)*(c + di) = whatever your result is using definition

// QUESTION: how is high dimensional complex number relate to quaternion

Compare Two Rotation Implementation

Compare Two Rotation Implementation

It gives us a easy way calculate \cos(75 \deg)

\begin{align*} \cos(75 \deg) &= \cos(45 \deg + 30 \deg)\\ &=(\cos(45 \deg) + \sin(45 \deg)\imath) * (\cos(30 \deg) + \sin(30 \deg)\imath)\\ &=(\frac{\sqrt{2}}{2} + \frac{\sqrt{2}}{2})\imath * (\frac{\sqrt{3}}{2} + \frac{1}{2}\imath)\\ &=\frac{\sqrt{6} - \sqrt{2}}{4}\\ \end{align*}

Quaternions

Definition: i^2 = j^2 = k^2 = ijk = -1

Hamilton Space: \mathbb{H} := \text{span}(\{1, \imath, \jmath, k\})

Interactive Video Explaining Quaternions

Quaternion Multiplication: it is complicated

Quaternion Multiplication: it is complicated

We can simplify above equation by viewing the real part as a scalar and the imagenary part as a vector (dot products and cross products).

Quaternion Multiplication in Vector Form:

(a, \overrightarrow{u})*(b, \overrightarrow{v}) = (ab - \overrightarrow{u} \cdot \overrightarrow{v}, a \overrightarrow{v} + b \overrightarrow{u} + \overrightarrow{u} \times \overrightarrow{v})

When the quaternions comes from \mathbb{R}^3 (ie a = b = 0), then we can simplify (0, \overrightarrow{u})*(0, \overrightarrow{v}) = \overrightarrow{u}*\overrightarrow{v} = \overrightarrow{u} \times \overrightarrow{v} - \overrightarrow{u} \cdot \overrightarrow{v}

Express Rotation with Quaternions

We first write vectors v \in \mathbb{R}^3 as the imagenary part of a quaternion x \in \text{Im}(\mathbb{H}) with zero real part.

Unit Quaternion: q \in \mathbb{H} | \|q\| = 1

Complex Reflection: let q = a + b\imath + c\jmath + dk, then \bar{q} = a - b\imath - c\jmath - dk

Rotation Expression: \bar{q}xq express some rotation along an axis. q = \cos(\theta / 2) + \sin(\theta / 2)\overrightarrow{u}

Rotation Interpolation

Slerp: spherical linear Interpolation

\text{Slerp}(q_0, q_1, t) = q_0(q_0^{-1}q_1)^t, t \in [0, 1]

Other Usage of Complex Numbers

Complex Number used in Preserving Angles in Warpped Texture

Complex Number used in Preserving Angles in Warpped Texture

Axis Angle Rotation

Represent 3D rotation using a rotational axis. That's it. Downside is that axis angle requires many trignometry and hard to think about.

Lie Algebras and Lie Groups

Lie Algebras and Lie Groups: another way to encode rotation, can encode larger than klzzwxh:0041 angle, good for statistics (average) on rotation

Lie Algebras and Lie Groups: another way to encode rotation, can encode larger than 2\pi angle, good for statistics (average) on rotation

Geometric Algebra

Table of Content