Autonomous Vehicle/Video Geometry

[3D Rotation Matrix] Euler angle

Naranjito 2025. 11. 20. 17:35
  • Euler angle

 

 

- Euler angles describe a sequence of rotations around the axes of a 3D coordinate system — typically:

  • Roll (α): rotation around the x-axis
  • Pitch (β): rotation around the y-axis
  • Yaw (γ): rotation around the z-axis

 

◦ Rotation around x-axis (Roll): \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos\theta & -\sin\theta \\ 0 & \sin\theta & \cos\theta \end{bmatrix}

- This keeps the x-value the same (notice first row is [1 0 0]).
- It rotates the point in the YZ plane.
- So imagine you're tilting your head sideways — that's roll.


◦ Rotation around y-axis (Pitch): \begin{bmatrix} \cos\theta & 0 & \sin\theta \\ 0 & 1 & 0 \\ -\sin\theta & 0 & \cos\theta \end{bmatrix}

 

- This keeps the y-value the same.

- It rotates the point in the XZ plane.

- Like when a plane tilts its nose up or down — that's pitch.

 


◦ Rotation around z-axis (Yaw): \begin{bmatrix} \cos\theta & -\sin\theta & 0 \\ \sin\theta & \cos\theta & 0 \\ 0 & 0 & 1 \end{bmatrix}

 

- This keeps the z-value the same.

- It rotates the point in the XY plane.

- Like turning your body left or right while standing — that's yaw.

 


  • Combining Rotations:
\begin{equation}R=R_z(\gamma)R_y(\beta)R_x(\alpha)\end{equation}

- This means: rotate around x, then y, then z — in that order. The order matters a lot because matrix multiplication is not commutative (i.e., AB≠BA).

- In here, the R is the elements of a 3×3 rotation matrix and looks like this:

\[ R = \begin{bmatrix} r_{11} & r_{12} & r_{13} \\ r_{21} & r_{22} & r_{23} \\ r_{31} & r_{32} & r_{33} \end{bmatrix} \]

Think of the matrix like a set of three new axes (basis vectors) after rotation:

Column 1: new x-axis direction

Column 2: new y-axis direction

Column 3: new z-axis direction

So:

\[ R = [\, e'_{x} \;\; e'_{y} \;\; e'_{z} \,] \]

Each column vector is a rotated unit axis.

For example, Rotation About the Z-axis:

\begin{bmatrix} \cos\theta & -\sin\theta & 0 \\ \sin\theta & \cos\theta & 0 \\ 0 & 0 & 1 \end{bmatrix}

Now, look at each element:

\begin{aligned} r_{11} &= \cos\theta &&: \text{x-to-x component (how much of original x stays in x direction)} \\ r_{12} &= -\sin\theta &&: \text{y-to-x component (how much y is projected onto new x)} \\ r_{21} &= \sin\theta &&: \text{x-to-y component} \\ r_{22} &= \cos\theta &&: \text{y-to-y component} \\ r_{33} &= 1 &&: \text{z remains unchanged since it's rotation around z-axis} \end{aligned}

 

  • Gimbal Lock

 

It happens when

- The pitch angle is ±90°

- Two rotation axes align, and you lose one degree of freedom

- The system can't distinguish between different roll/yaw combinations — multiple combinations of α and γ result in the same orientation.