其他分享
首页 > 其他分享> > 欧拉角与旋转矩阵

欧拉角与旋转矩阵

作者:互联网

一、欧拉角与旋转矩阵

对于两个三维点 p_1(x_1,y_1,z_1)p_2(x_2,y_2,z_2),由点p_1经过旋转矩阵R旋转到p_2,则有:
                                                  R=\begin{bmatrix}r_{11} & r_{12} & r_{13} \\ r_{21} & r_{22} & r_{23} \\ r_{31} & r_{32} & r_{33} \end{bmatrix}

                                                     \begin{bmatrix}x_2 \\ y_2 \\ z_2 \end{bmatrix} = R\begin{bmatrix}x_1 \\ y_1 \\ z_1 \end{bmatrix}

任何一个旋转可以表示为依次绕着三个旋转轴旋三个角度的组合。这三个角度称为欧拉角。 对于在三维空间里的一个参考系,任何坐标系的取向,都可以用三个欧拉角来表现,如下图(蓝色是起始坐标系,而红色的是旋转之后的坐标系) :

                                                                                                                                                       
                                                  R_x({\theta}) =\begin{bmatrix}1 & 0 & 0 \\ 0 & cos\theta & -sin\theta \\0 & sin\theta & cos\theta \end{bmatrix}
                                                  R_y({\theta}) =\begin{bmatrix}cos\theta & 0 & sin\theta \\ 0 & 1 & 0 \\ -sin\theta & 0 & cos\theta \end{bmatrix}
                                                  R_z({\theta}) =\begin{bmatrix}cos\theta & -sin\theta & 0 \\ sin\theta & cos\theta & 0 \\ 0 & 0 & 1 \end{bmatrix}

 

因此欧拉角转旋转矩阵如下:
R =R_z(\phi)R_y(\theta)R_x(\psi)=\begin{bmatrix} cos\theta cos\phi & sin\psi sin\theta cos\phi - cos\psi sin\theta & cos \psi sin\theta cos\phi +sin\psi sin\phi \\cos\theta sin\phi & sin\psi sin\theta sin\phi+cos\psi cos\phi & cos\psi sin\theta sin\phi -sin\psi cos\theta \\ -sin\theta & sin\psi cos\theta & cos\psi cos\theta\end{bmatrix}
则可以如下表示欧拉角:
                                                         \theta_x=atan2(r_{32},r_{33})
                                                        \theta_y=atan2(-r_{31},\sqrt{r_{32}^2+r_{33}^2})
                                                        \theta_z=atan2(r_{21},r_{11})

转自:https://www.jianshu.com/p/5e130c04a602

标签:欧拉角,矩阵,如下,三个,旋转,坐标系
来源: https://www.cnblogs.com/Jack-Elvis/p/15927828.html