原文见我的博客主站,欢迎大家过去评论。
如何描述三维空间中刚体的旋转,是个有趣的问题。具体地说,就是刚体上的任意一个点P(x, y, z)围绕过原点的轴(i, j, k)旋转θ,求旋转后的点P\'(x\', y\', z\')。
旋转矩阵
旋转矩阵乘以点P的齐次坐标,得到旋转后的点P',因此旋转矩阵可以描述旋转,
$$\begin{bmatrix}x'\\ y'\\ z'\\ 1\end{bmatrix}=R\cdot \begin{bmatrix}x\\ y\\ z\\ 1\end{bmatrix}$$
绕x,y,或z轴旋转θ的矩阵为:
$$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}\c