# 两种欧拉角与其对应的旋转矩阵求解

## 欧拉角定义

• O x y z Oxyz 是世界坐标系，是固定不变的。
• O X Y Z OXYZ 是被旋转的局部坐标系。

## 三维旋转矩阵

### 基本旋转矩阵

R ( θ ) = [ cos ⁡ θ − sin ⁡ θ sin ⁡ θ cos ⁡ θ ] R(\theta)=\left[\begin{matrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \\ \end{matrix}\right]

R x ( ψ ) = [ 1 0 0 0 cos ⁡ ψ − sin ⁡ ψ 0 sin ⁡ ψ cos ⁡ ψ ] R y ( θ ) = [ cos ⁡ θ 0 sin ⁡ θ 0 1 0 − sin ⁡ θ 0 cos ⁡ θ ] R z ( φ ) = [ cos ⁡ φ − sin ⁡ φ 0 sin ⁡ φ cos ⁡ φ 0 0 0 1 ] R_x(\psi)=\left[\begin{matrix} 1 & 0 & 0 \\ 0 & \cos\psi & -\sin\psi \\ 0 & \sin\psi & \cos\psi \end{matrix}\right] \\ \quad \\ R_y(\theta)=\left[\begin{matrix} \cos\theta & 0 & \sin\theta \\ 0 & 1 & 0 \\ -\sin\theta & 0 & \cos\theta \end{matrix}\right] \\ \quad \\ R_z(\varphi)=\left[\begin{matrix} \cos\varphi & -\sin\varphi & 0 \\ \sin\varphi & \cos\varphi & 0 \\ 0 & 0 & 1 \end{matrix}\right]

## 旋转矩阵和两种欧拉角

• 最开始全局坐标系和局部坐标系是重合的；

• 旋转的顺序都是 x y z ( X Y Z ) xyz(XYZ)

• 旋转角保持和前面一节一致：分别是 ψ , θ , φ \psi, \theta, \varphi .

### 绕局部坐标轴旋转

R x P x = P 0 R_xP_x=P_0

R y P x y = P x R z P x y z = P x y R_yP_{xy}=P_x\\ \quad \\ R_zP_{xyz}=P_{xy}

R x R y R z P 1 = P 0 R_xR_yR_zP_1=P_0

R l o c a l = R x R y R z R_{local}=R_xR_yR_z

P 1 = R z T R y T R x T P 0 P_1=R_z^TR_y^TR_x^TP_0

### 绕全局坐标轴旋转

R x P x = P 0 R_xP_x=P_0

n y = R x T [ 0 1 0 ] T \bm{n_y}=R_x^T\left[0\quad 1\quad 0\right]^T \\

R x y P x y = P x R_{xy}P_{xy}=P_x

n z = R x y T R x T [ 0 0 1 ] T \bm{n_z}=R_{xy}^TR_x^T[0\quad 0\quad 1]^T
n z \bm{n_z} 旋转角度 φ \varphi 的矩阵是 R x y z R_{xyz} ，那么
R x y z P x y z = P x y R_{xyz}P_{xyz}=P_{xy}

R g l o b a l = R x R x y R x y z R_{global}=R_xR_{xy}R_{xyz}

#### 勘误

R g l o b a l = R z R y R x R_{global}=R_zR_yR_x

[ ε 1 ε 2 ε 3 ] = [ 1 0 0 0 1 0 0 0 1 ] [\boldsymbol{\varepsilon}_1\quad\boldsymbol{\varepsilon}_2\quad\boldsymbol{\varepsilon}_3]= \left[\begin{matrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{matrix}\right] \\

ε 1 ′ = R z R y R x ε 1 \boldsymbol{\varepsilon}_1^\prime=R_zR_yR_x\boldsymbol{\varepsilon}_1

[ ε 1 ′ ε 2 ′ ε 3 ′ ] = R z R y R x [ ε 1 ε 2 ε 3 ] [\boldsymbol{\varepsilon}_1^\prime\quad\boldsymbol{\varepsilon}_2^\prime\quad\boldsymbol{\varepsilon}_3^\prime]=R_zR_yR_x[\boldsymbol{\varepsilon}_1\quad\boldsymbol{\varepsilon}_2\quad\boldsymbol{\varepsilon}_3]

[ ε 1 ′ ε 2 ′ ε 3 ′ ] = R z R y R x [\boldsymbol{\varepsilon}_1^\prime\quad\boldsymbol{\varepsilon}_2^\prime\quad\boldsymbol{\varepsilon}_3^\prime]=R_zR_yR_x

[ ε 1 ′ ε 2 ′ ε 3 ′ ] P 1 = [ ε 1 ε 2 ε 3 ] P 0 [\boldsymbol{\varepsilon}_1^\prime\quad\boldsymbol{\varepsilon}_2^\prime\quad\boldsymbol{\varepsilon}_3^\prime]P_1=[\boldsymbol{\varepsilon}_1\quad\boldsymbol{\varepsilon}_2\quad\boldsymbol{\varepsilon}_3]P_0

R z R y R x P 1 = P 0 R_zR_yR_xP_1=P_0

### 转向量的情形

P 1 = R z R y R x P 0 P_1=R_zR_yR_xP_0

R z T R y T R x T P 1 = P 0 R_z^TR_y^TR_x^TP_1=P_0

P 1 = R x R y R z P 0 P_1=R_xR_yR_zP_0

## The End

Thx.

03-16
05-21 4万+

08-03 1万+
09-25 1万+
10-22
04-14
09-06
10-16 5220
06-27 1618
07-25 3285
©️2020 CSDN 皮肤主题: 数字20 设计师:CSDN官方博客