旋转矩阵(维基百科)

旋转矩阵[编辑]

维基百科,自由的百科全书

旋转矩阵(Rotation matrix)是在乘以一个向量的时候有改变向量的方向但不改变大小的效果的矩阵。旋转矩阵不包括反演,它可以把右手坐标系改变成左手坐标系或反之。所有旋转加上反演形成了正交矩阵的集合。旋转可分为主动旋转与被动旋转。主动旋转是指将向量逆时针围绕旋转轴所做出的旋转。被动旋转是对坐标轴本身进行的逆时针旋转,它相当于主动旋转的逆操作。

目录

   [隐藏

性质[编辑]

设 \mathbf{M} 是任何维的一般旋转矩阵: \mathbf{M}\in\mathbb{R}^{n \times n}

  • 两个向量的点积(内积)在它们都被一个旋转矩阵操作之后保持不变:
\mathbf{a}\cdot\mathbf{b} = \mathbf{M}\mathbf{a}\cdot\mathbf{M}\mathbf{b}
\mathbf{M}\,\mathbf{M}^{-1}=\mathbf{M}\,\mathbf{M}^\top=\mathcal{I}    这里的  \mathcal{I} 是单位矩阵。
  • 一个矩阵是旋转矩阵,当且仅当它是正交矩阵并且它的行列式是单位一。正交矩阵的行列式是 ±1;如果行列式是 −1,则它包含了一个反射而不是真旋转矩阵。
\mathbf{M}=\exp (\mathbf{A})=\sum_{k=0}^\infty \frac{\mathbf{A}^k}{k!}
这里的指数是以 泰勒级数定义的而  \mathbf{A}^k 是以 矩阵乘法定义的。 A 矩阵叫做旋转的“生成元”。旋转矩阵的 李代数是它的生成元的代数,它就是斜对称矩阵的代数。生成元可以通过 M 的 矩阵对数来找到。

二维空间[编辑]

在二维空间中,旋转可以用一个单一的角 \theta 定义。作为约定,正角表示逆时针旋转。把笛卡尔坐标列向量关于原点逆时针旋转 \theta 的矩阵是:

  M(\theta) = \begin{bmatrix}     \cos{\theta} & -\sin{\theta} \\    \sin{\theta} & \cos{\theta}   \end{bmatrix}  =\cos{\theta}\begin{bmatrix}    1 & 0 \\    0 & 1  \end{bmatrix}  +\sin{\theta}\begin{bmatrix}    0 & -1 \\    1 & 0   \end{bmatrix}  = \exp\left(\theta\begin{bmatrix}     0 & -1 \\    1 & 0   \end{bmatrix}\right)

三维空间[编辑]

在三维空间中,旋转矩阵有一个等于单位1的实特征值。旋转矩阵指定关于对应的特征向量的旋转(欧拉旋转定理)。如果旋转角是 θ,则旋转矩阵的另外两个(复数)特征值是 exp(iθ) 和 exp(-iθ)。从而得出 3 维旋转的迹数等于 1 + 2 cos(θ),这可用来快速的计算任何 3 维旋转的旋转角。

3 维旋转矩阵的生成元是三维斜对称矩阵。因为只需要三个实数来指定 3 维斜对称矩阵,得出只用三个是实数就可以指定一个 3 维旋转矩阵。

Roll, Pitch 和 Yaw[编辑]

生成旋转矩阵的一种简单方式是把它作为三个基本旋转的序列复合。关于右手笛卡尔坐标系的 x-, y- 和 z-轴的旋转分别叫做 pitchyaw 和 roll 旋转。因为这些旋转被表达为关于一个轴的旋转,它们的生成元很容易表达。

  • 绕 x-轴的主动旋转定义为:
  \mathcal{R}_x(\theta_x)=  \begin{bmatrix}    1 & 0 & 0 \\    0 &  \cos{\theta_x} &  -\sin{\theta_x} \\    0 &  \sin{\theta_x} & \cos{\theta_x}  \end{bmatrix}  =\exp \left(  \begin{bmatrix}    0 & 0 & 0 \\    0 & 0 & \theta_x \\    0 & -\theta_x & 0  \end{bmatrix}\right) 这里的  \theta_x 是 roll 角。
  • 绕 y-轴的主动旋转定义为:
  \mathcal{R}_y(\theta_y)=  \begin{bmatrix}    \cos{\theta_y} & 0 & \sin{\theta_y} \\    0 & 1 & 0 \\     -\sin{\theta_y} & 0 & \cos{\theta_y}  \end{bmatrix}   =\exp\left(  \begin{bmatrix}    0 & 0 & - \theta_y \\    0 & 0 & 0 \\    \theta_y & 0 & 0  \end{bmatrix}\right) 这里的  \theta_y 是 pitch 角。
  • 绕 z-轴的主动旋转定义为:
  \mathcal{R}_z(\theta_z)=  \begin{bmatrix}     \cos{\theta_z} &   -\sin{\theta_z} & 0 \\    \sin{\theta_z} & \cos{\theta_z} & 0 \\    0 & 0 & 1   \end{bmatrix}  =\exp\left(  \begin{bmatrix}     0 & \theta_z & 0 \\    - \theta_z & 0 & 0 \\    0 & 0 & 0   \end{bmatrix}\right) 这里的  \theta_z 是 yaw 角。
Flight dynamics with text.png

飞行动力学中,roll, pitch 和 yaw 角通常分别采用符号 \gamma\alpha, 和 \beta;但是为了避免混淆于欧拉角这里使用符号\theta_x\theta_y 和 \theta_z

任何 3 维旋转矩阵 \mathcal{M}\in\mathbb{R}^{3\times 3} 都可以用这三个角 \theta_x\theta_y, 和 \theta_z 来刻画,并且可以表示为 roll, pitch 和 yaw 矩阵的乘积。

\mathcal{M} 是在   \mathbb{R}^{3\times 3}\, 中的旋转矩阵  \Leftrightarrow\,\exist\,\theta_x,\theta_y,\theta_z\in[0\ldots\pi):\,\mathcal{M}=\mathcal{R}_z(\theta_z)\,\mathcal{R}_y(\theta_y)\,\mathcal{R}_x(\theta_x)

在 \mathbb{R}^3 中所有旋转的集合,加上复合运算形成了旋转群 SO(3)。这里讨论的矩阵接着提供了这个群的群表示。更高维的情况可参见 Givens旋转

角-轴表示和四元数表示[编辑]

在三维中,旋转可以通过单一的旋转角 \theta 和所围绕的单位向量方向 \hat{\mathbf{v}} = (x,y,z) 来定义。

 \mathcal{M}(\hat{\mathbf{v}},\theta) = \begin{bmatrix}   \cos \theta + (1 - \cos \theta) x^2 & (1 - \cos \theta) x y - (\sin \theta) z  & (1 - \cos \theta) x z + (\sin \theta) y  \\   (1 - \cos \theta) y x + (\sin \theta) z  & \cos \theta + (1 - \cos \theta) y^2 & (1 - \cos \theta) y z - (\sin \theta) x\\   (1 - \cos \theta) z x - (\sin \theta) y & (1 - \cos \theta) z y + (\sin \theta) x & \cos \theta + (1 - \cos \theta) z^2 \end{bmatrix}

这个旋转可以简单的以生成元来表达:

 \mathcal{M}(\hat{\mathbf{v}},\theta)  = \exp\left( \begin{bmatrix}         0   &  -z\theta & y\theta \\   z\theta &     0    &  -x\theta  \\    -y\theta & x\theta &      0    \\\end{bmatrix}\right)

在运算于向量 r 上的时候,这等价于Rodrigues旋转公式

\mathcal{M} \cdot \mathbf{r} = \mathbf{r} \,\cos(\theta)+\hat{\mathbf{v}}\times \mathbf{r}\, \sin(\theta)+(\hat{\mathbf{v}}\cdot\mathbf{r})\hat{\mathbf{v}}(1-\cos(\theta))

角-轴表示密切关联于四元数表示。依据轴和角,四元数可以给出为正规化四元数 Q:

Q=(xi+yj+zk)\sin(\theta/2)+\cos(\theta/2)\,

这里的 ij 和 k 是 Q 的三个虚部。

欧拉角表示[编辑]

在三维空间中,旋转可以通过三个欧拉角 (\alpha,\beta,\gamma) 来定义。有一些可能的欧拉角定义,每个都可以依据 roll, pitch 和 yaw 的复合来表达。依据 "z-x-z" 欧拉角,在右手笛卡尔坐标中的主动旋转矩阵可表达为:

 \mathcal{M}(\alpha,\beta,\gamma)=\mathcal{R}_z(\alpha)\mathcal{R}_x(\beta) \mathcal{R}_z(\gamma)

进行乘法运算生成:

 \mathcal{M}(\alpha,\beta,\gamma) = \begin{bmatrix} \cos\alpha \cos\gamma - \cos\beta \sin\alpha \sin\gamma &-\cos\beta \cos\gamma \sin\alpha - \cos\alpha \sin\gamma & \sin\alpha \sin\beta\\ \cos\gamma \sin\alpha + \cos\alpha \cos\beta \sin\gamma & \cos\alpha \cos\beta \cos\gamma - \sin\alpha \sin\gamma &-\cos\alpha \sin\beta\\ \sin\beta \sin\gamma & \cos\gamma \sin\beta & \cos\beta\end{bmatrix}

因为这个旋转矩阵不可以表达为关于一个单一轴的旋转,它的生成元不能像上面例子那样简单表达出来。

对称保持 SVD 表示[编辑]

对旋转轴 q 和旋转角 \theta,旋转矩阵

 \mathcal{M} = qq^T+QGQ^T

这里的 Q=\begin{bmatrix}q_1, & q_2\end{bmatrix} 的纵列张开正交于 q 的空间而 G 是 \theta 度 Givens 旋转,就是说

 G = \begin{bmatrix}\cos\theta & \sin\theta\\-\sin\theta & \cos\theta\end{bmatrix}

参见[编辑]

外部链接[编辑]

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值