# 旋转矩阵

旋转矩阵是一种实方阵，它在保持向量长度和手性的同时旋转向量：它是一个行列式等于 +1 的正交矩阵<sup>[1](https://www.math.ucla.edu/~baker/149.1.02w/handouts/f_orthog.pdf)</sup>。等价地，矩阵 \( R \) 是旋转矩阵当且仅当 \( R^{T}R = RR^{T} = I \) 且 \( \det(R) = 1 \)<sup>[2](https://courses.cs.duke.edu/cps274/fall11/notes/Math.pdf)</sup>。单位矩阵也算作一种旋转，对应于零角度的旋转<sup>[1](https://www.math.ucla.edu/~baker/149.1.02w/handouts/f_orthog.pdf)</sup>。行列式为 −1 的正交矩阵，例如 \( -I \)，是反演或反射，而非旋转，因为负的行列式会反转取向<sup>[2](https://courses.cs.duke.edu/cps274/fall11/notes/Math.pdf)</sup>。

| 关键事实 | 细节 |
|---|---|
| 定义 | 行列式为 +1 的实正交矩阵；\( R^{T}R = RR^{T} = I \) 且 \( \det(R) = 1 \)<sup>[1](https://www.math.ucla.edu/~baker/149.1.02w/handouts/f_orthog.pdf)</sup><sup> • </sup><sup>[2](https://courses.cs.duke.edu/cps274/fall11/notes/Math.pdf)</sup> |
| 群结构 | \( n \times n \) 旋转矩阵构成特殊正交群 \( SO(n) \)；旋转矩阵的乘积和逆仍是旋转矩阵，且逆等于转置<sup>[1](https://www.math.ucla.edu/~baker/149.1.02w/handouts/f_orthog.pdf)</sup><sup> • </sup><sup>[3](https://opentextbooks.clemson.edu/wangrobotics/chapter/forward-kinematics/)</sup> |
| 二维形式 | 每个 \( 2 \times 2 \) 旋转矩阵都是 \( \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix} \)，即绕原点逆时针旋转 \( \theta \)<sup>[1](https://www.math.ucla.edu/~baker/149.1.02w/handouts/f_orthog.pdf)</sup><sup> • </sup><sup>[3](https://opentextbooks.clemson.edu/wangrobotics/chapter/forward-kinematics/)</sup> |
| 几何意义 | 3×3 旋转矩阵的行（或列）是旋转后坐标系的单位向量在原坐标系中的表示；元素 \( r_{ij} \) 是第 i 个新单位向量在第 j 个旧单位向量上的投影<sup>[2](https://courses.cs.duke.edu/cps274/fall11/notes/Math.pdf)</sup> |
| 自由度 | 在正交性、长度保持和手性的约束下，3×3 旋转矩阵恰好有 3 个自由度<sup>[4](https://math.stackexchange.com/questions/4833246/why-do-euler-angles-suffer-from-gimbal-lock-but-not-rotation-matrices)</sup> |
| 在机器人学中的作用 | 旋转矩阵 \( R \) 指定了物体坐标系在固定坐标系中的取向；与位置向量结合构成 4×4 齐次变换矩阵，即 \( SE(3) \) 的元素<sup>[5](https://modernrobotics.northwestern.edu/nu-gm-book-resource/3-3-1-homogeneous-transformation-matrices/)</sup> |
| 替代表示 | 欧拉角、轴角、旋转向量和单位四元数都编码同一旋转；四元数是连续的，组合起来和矩阵一样容易，且归一化很简单<sup>[6](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0276302)</sup> |

## 代数性质

旋转矩阵在几何上有意义的运算下是封闭的。两个 \( n \times n \) 旋转矩阵的乘积是旋转矩阵，旋转矩阵的逆是旋转矩阵；事实上逆就是转置，\( R^{-1} = R^{T} \)<sup>[1](https://www.math.ucla.edu/~baker/149.1.02w/handouts/f_orthog.pdf)</sup>。从几何上看，这种正交性反映了矩阵的行是相互正交的单位向量：在三维中，行 \( i^{T}, j^{T}, k^{T} \) 满足 \( i \times j = k \)、\( j \times k = i \) 和 \( k \times i = j \)，这保持了手性，并使按行三重积计算的行列式等于 1<sup>[2](https://courses.cs.duke.edu/cps274/fall11/notes/Math.pdf)</sup>。

所有 \( n \times n \) 旋转矩阵的集合构成特殊正交群 \( SO(n) \)<sup>[3](https://opentextbooks.clemson.edu/wangrobotics/chapter/forward-kinematics/)</sup>。该群内的矩阵乘法满足结合律，但一般不满足交换律，因此连续旋转的顺序很重要<sup>[5](https://modernrobotics.northwestern.edu/nu-gm-book-resource/3-3-1-homogeneous-transformation-matrices/)</sup>。

## 二维与三维

在平面中，每个旋转矩阵都具有形式

\[
R = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix},
\]

它使向量绕原点逆时针旋转角度 \( \theta \)<sup>[1](https://www.math.ucla.edu/~baker/149.1.02w/handouts/f_orthog.pdf)</sup><sup> • </sup><sup>[3](https://opentextbooks.clemson.edu/wangrobotics/chapter/forward-kinematics/)</sup>。

在三维中，绕坐标轴的基本旋转为

\[
R_{z,\theta} = \begin{bmatrix} \cos\theta & -\sin\theta & 0 \\ \sin\theta & \cos\theta & 0 \\ 0 & 0 & 1 \end{bmatrix}, \quad
R_{x,\theta} = \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos\theta & -\sin\theta \\ 0 & \sin\theta & \cos\theta \end{bmatrix}, \quad
R_{y,\theta} = \begin{bmatrix} \cos\theta & 0 & \sin\theta \\ 0 & 1 & 0 \\ -\sin\theta & 0 & \cos\theta \end{bmatrix}.
\]

一般的三维旋转通过乘以这样的矩阵得到，乘法的顺序编码了每次旋转所在的坐标系：绕固定坐标系或世界坐标系旋转时左乘，绕当前坐标系旋转时右乘<sup>[3](https://opentextbooks.clemson.edu/wangrobotics/chapter/forward-kinematics/)</sup>。在三维中，正是欧拉定理使旋转矩阵得以成立：刚体绕单一固定点转动的任何运动，都等价于绕某一特定轴转过一个角度。<sup>[7](https://ntrs.nasa.gov/api/citations/20020060647/downloads/20020060647.pdf)</sup>

## 用作坐标系描述

3×3 旋转矩阵的行是旋转后坐标系在原坐标系中表示的单位向量，因此该矩阵同时也可描述一个坐标系相对于另一个坐标系的关系<sup>[2](https://courses.cs.duke.edu/cps274/fall11/notes/Math.pdf)</sup>。在机器人学中，物体坐标系 \( \{b\} \) 在空间坐标系 \( \{s\} \) 中的取向由这样的矩阵 \( R \) 给出；附加位置向量 \( p \) 得到 4×4 齐次变换矩阵 \( T \)，所有此类矩阵的集合是特殊欧几里得群 \( SE(3) \)<sup>[5](https://modernrobotics.northwestern.edu/nu-gm-book-resource/3-3-1-homogeneous-transformation-matrices/)</sup>。变换矩阵继承了旋转矩阵的性质：每个变换矩阵都有一个逆，该逆与原矩阵的乘积为单位矩阵，且两个变换矩阵的乘积仍是变换矩阵<sup>[5](https://modernrobotics.northwestern.edu/nu-gm-book-resource/3-3-1-homogeneous-transformation-matrices/)</sup>。

NASA 的姿态文献将 3×3 正交姿态矩阵（也称为方向余弦矩阵）视为航天器姿态最基本的表示<sup>[7](https://ntrs.nasa.gov/api/citations/20020060647/downloads/20020060647.pdf)</sup>。

## 与其他旋转表示的比较

三维旋转可以用多种方式编码，旋转矩阵是与欧拉角、轴角形式和四元数并列的四大表示之一<sup>[8](https://motion.cs.illinois.edu/RoboticSystems/3DRotations.html)</sup>。每种表示都在存储、可组合性和鲁棒性之间做出权衡。

**欧拉角**将旋转存储为三个数，紧凑且为大多数工程师所熟悉，但它们是不连续的，难以直接组合，且受万向节锁影响——此时两个轴对齐，参数化变得欠定；此外还有 12 种可能的轴序列，计入内旋与外旋约定则为 24 种，因此每个应用都必须跟踪正确的序列<sup>[6](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0276302)</sup>。旋转矩阵不受万向节锁影响，这是它们被优先用作内部表示的原因之一<sup>[4](https://math.stackexchange.com/questions/4833246/why-do-euler-angles-suffer-from-gimbal-lock-but-not-rotation-matrices)</sup>。

**四元数**使用四个数，并带有一个单位长度约束。当范数等于 1 时，它们组合起来和旋转矩阵一样容易，连续变化，且容易从轴角表示构建；它们也可以简单地归一化，这远比相应的矩阵正交化问题廉价。由于这些原因，大多数三维图形应用和旋转引擎在内部使用四元数<sup>[6](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0276302)</sup>。一项机器人运动学研究得出结论：四元数-向量对与齐次变换一样高效、比其更紧凑、也更优雅<sup>[9](https://ieeexplore.ieee.org/document/56658/)</sup>。四元数映射是二对一的：\( q \) 和 \( -q \) 表示同一个旋转矩阵<sup>[7](https://ntrs.nasa.gov/api/citations/20020060647/downloads/20020060647.pdf)</sup>。

**旋转向量**将轴和角组合为 \( \theta e \)，但该表示的运动学方程在 \( \theta = 2\pi \) 处奇异，且当姿态平滑变化时该表示可能在对跖点之间跳跃，限制了其作为全局姿态表示的实用性<sup>[7](https://ntrs.nasa.gov/api/citations/20020060647/downloads/20020060647.pdf)</sup>。

## 数值实践

浮点运算会逐渐破坏存储的旋转矩阵的正交性，因此软件会定期重新正交化。SciPy 的 `Rotation.from_matrix` 通过先将任何非正交输入矩阵正交化，再将其转换为内部四元数形式来处理这一问题；有效的旋转矩阵是行和列均为单位范数且行列式为 1 的正交矩阵，且矩阵必须是右手系<sup>[10](https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.transform.Rotation.from_matrix.html)</sup>。

## 历史

有限旋转公式常被归于罗德里格斯（Rodrigues），但历史分析表明，欧拉（Euler）在 1775 年首先以旋转轴的方向余弦和旋转角的形式导出了它；罗德里格斯则负责连续有限旋转的组合公式以及欧拉-罗德里格斯参数，后者发表于 1840 年，比哈密顿（Hamilton）1843 年引入四元数早三年<sup>[11](https://cir.nii.ac.jp/crid/1361699995290992896)</sup><sup> • </sup><sup>[12](https://ndl.ethernet.edu.et/bitstream/123456789/26511/1/399.pdf)</sup>。

## References

1. [Rotation matrices, UCLA Math 149 handout (A. Baker)](https://www.math.ucla.edu/~baker/149.1.02w/handouts/f_orthog.pdf)
2. [Computer Vision lecture notes, Duke University CPS 274](https://courses.cs.duke.edu/cps274/fall11/notes/Math.pdf)
3. [Forward Kinematics, Modeling, Motion Planning, and Control of Manipulators and Mobile Robots, Clemson University Open Textbooks](https://opentextbooks.clemson.edu/wangrobotics/chapter/forward-kinematics/)
4. [Why do Euler angles suffer from gimbal lock but not rotation matrices?, Mathematics Stack Exchange](https://math.stackexchange.com/questions/4833246/why-do-euler-angles-suffer-from-gimbal-lock-but-not-rotation-matrices)
5. [Modern Robotics, Chapter 3.3.1: Homogeneous Transformation Matrices, Lynch and Park, Northwestern University](https://modernrobotics.northwestern.edu/nu-gm-book-resource/3-3-1-homogeneous-transformation-matrices/)
6. [Quaternion to Euler angles conversion: A direct, general and computationally efficient method, PLOS One (2022)](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0276302)
7. [Attitude Parameterizations, NASA Goddard Space Flight Center](https://ntrs.nasa.gov/api/citations/20020060647/downloads/20020060647.pdf)
8. [Robotic Systems, 3D Rotations, Kris Hauser, University of Illinois](https://motion.cs.illinois.edu/RoboticSystems/3DRotations.html)
9. [On homogeneous transforms, quaternions, and computational efficiency, IEEE Transactions on Robotics and Automation, 1990](https://ieeexplore.ieee.org/document/56658/)
10. [scipy.spatial.transform.Rotation.from_matrix, SciPy v1.18.0 Manual](https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.transform.Rotation.from_matrix.html)
11. [An Historical Note on Finite Rotations, CiNii Research](https://cir.nii.ac.jp/crid/1361699995290992896)
12. [Historical Overview of Geometric Algebra](https://ndl.ethernet.edu.et/bitstream/123456789/26511/1/399.pdf)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Linear and multilinear algebra › Matrix theory › Structured and special matrix classes

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/rotation-matrix

English original: https://www.edgepedia.org/rotation-matrix
