旋轉矩陣(英語:Rotation matrix)是在乘以一個向量的時候有改變向量的方向但不改變大小的效果並保持了手性的矩陣。旋轉矩陣不包括點反演,點反演可以改變手性,也就是把右手坐標系改變成左手坐標系或反之。所有旋轉加上反演形成了正交矩陣的集合。旋轉可分為主動旋轉與被動旋轉。主動旋轉是指將向量逆時針圍繞旋轉軸所做出的旋轉。被動旋轉是對坐標軸本身進行的逆時針旋轉,它相當於主動旋轉的逆操作。
性質
設
是任何維的一般旋轉矩陣:
- 兩個向量的點積(內積)在它們都被一個旋轉矩陣操作之後保持不變:
![{\displaystyle \mathbf {a} ^{\top }\cdot \mathbf {b} =\mathbf {(Ma)} ^{\top }\cdot \mathbf {M} \mathbf {b} }](//wikimedia.org/api/rest_v1/media/math/render/svg/ae8ee148339dfea4de5a4724b1e71938d9e99ea4)
這裏的
是單位矩陣。
- 一個矩陣是旋轉矩陣,若且唯若它是正交矩陣並且它的行列式是1。正交矩陣的行列式是 ±1;如果行列式是 −1,則它包含了一個反射而不是真旋轉矩陣。
- 旋轉矩陣是正交矩陣,如果它的列向量形成
的一個正交基,就是說在任何兩個列向量之間的純量積是零(正交性)而每個列向量的大小是單位一(單位向量)。
![{\displaystyle \mathbf {M} =\exp(\mathbf {A} )=\sum _{k=0}^{\infty }{\frac {\mathbf {A} ^{k}}{k!}}}](//wikimedia.org/api/rest_v1/media/math/render/svg/af2c2ef52386d839e15117e188ffcc34ca49c186)
- 這裏的指數是以泰勒級數定義的而
是以矩陣乘法定義的。矩陣A叫做旋轉的「生成元」。旋轉矩陣的李代數是它的生成元的代數,它就是斜對稱矩陣的代數。生成元可以通過 M 的矩陣對數來找到。
二維空間
在二維空間中,旋轉可以用一個單一的角
定義。作為約定,正角表示逆時針旋轉。把笛卡爾坐標的列向量關於原點逆時針旋轉
的矩陣是:
![{\displaystyle 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)}](//wikimedia.org/api/rest_v1/media/math/render/svg/60b587aaa73b23111bd835223f32a4b71a1b3f8b)
三維空間
在三維空間中,旋轉矩陣有一個等於單位1的實特徵值。旋轉矩陣指定關於對應的特徵向量的旋轉(歐拉旋轉定理)。如果旋轉角是 θ,則旋轉矩陣的另外兩個(複數)特徵值是 exp(iθ) 和 exp(-iθ)。從而得出 3 維旋轉的跡數等於 1 + 2 cos(θ),這可用來快速的計算任何 3 維旋轉的旋轉角。
3 維旋轉矩陣的生成元是三維斜對稱矩陣。因為只需要三個實數來指定 3 維斜對稱矩陣,得出只用三個實數就可以指定一個 3 維旋轉矩陣。
旋轉
主條目:Tait-Bryan角
生成旋轉矩陣的一種簡單方式是把它作為三個基本旋轉的序列複合。關於右手笛卡爾坐標系的 x-, y- 和 z-軸的旋轉分別叫做 roll, pitch 和 yaw 旋轉。因為這些旋轉被表達為關於一個軸的旋轉,它們的生成元很容易表達。
這裏的
是 roll 角,和右手螺旋的方向相反(在yz平面順時針)。
這裏的
是 pitch 角,和右手螺旋的方向相反(在zx平面順時針)。
這裏的
是 yaw 角,和右手螺旋的方向相反(在xy平面順時針)。
在飛行動力學中,roll, pitch 和 yaw 角通常分別採用符號
,
, 和
;但是為了避免混淆於歐拉角這裏使用符號
,
和
。
任何 3 維旋轉矩陣
都可以用這三個角
,
, 和
來刻畫,並且可以表示為 roll, pitch 和 yaw 矩陣的乘積。
是在
中的旋轉矩陣 ![{\displaystyle \Leftrightarrow \,\exists \,\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})}](//wikimedia.org/api/rest_v1/media/math/render/svg/038bf15824cf6abb4c4ea91b082c0ffadbfbf175)
在
中所有旋轉的集合,加上複合運算形成了旋轉群 SO(3)。這裏討論的矩陣接着提供了這個群的群表示。更高維的情況可參見 Givens旋轉。
角-軸表示和四元數表示
在三維中,旋轉可以通過單一的旋轉角
和所圍繞的單位向量方向
來定義。
![{\displaystyle {\mathcal {M}}({\hat {\mathbf {v} }},\theta )={\begin{bmatrix}\cos \theta +(1-\cos \theta )x^{2}&(1-\cos \theta )xy-(\sin \theta )z&(1-\cos \theta )xz+(\sin \theta )y\\(1-\cos \theta )yx+(\sin \theta )z&\cos \theta +(1-\cos \theta )y^{2}&(1-\cos \theta )yz-(\sin \theta )x\\(1-\cos \theta )zx-(\sin \theta )y&(1-\cos \theta )zy+(\sin \theta )x&\cos \theta +(1-\cos \theta )z^{2}\end{bmatrix}}}](//wikimedia.org/api/rest_v1/media/math/render/svg/82ae91c80b3a29d990f46fb016519e510517aa3e)
這個旋轉可以簡單的以生成元來表達:
![{\displaystyle {\mathcal {M}}({\hat {\mathbf {v} }},\theta )=\exp \left(\theta {\begin{bmatrix}0&-z&y\\z&0&-x\\-y&x&0\\\end{bmatrix}}\right)}](//wikimedia.org/api/rest_v1/media/math/render/svg/c9f6bd325bc7cec775cacff74215e11c2542061f)
在運算於向量 r 上的時候,這等價於Rodrigues旋轉公式:
![{\displaystyle {\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 ))}](//wikimedia.org/api/rest_v1/media/math/render/svg/339fb1dea0c0b807b28a8d2e203c63d9056b5412)
角-軸表示密切關聯於四元數表示。依據軸和角,四元數可以給出為正規化四元數 Q:
![{\displaystyle Q=(xi+yj+zk)\sin(\theta /2)+\cos(\theta /2)\,}](//wikimedia.org/api/rest_v1/media/math/render/svg/39fe2a13bb3dd5cc134da2bbafb769ae80d89aa1)
這裏的 i, j 和 k 是 Q 的三個虛部。
歐拉角表示
在三維空間中,旋轉可以通過三個歐拉角
來定義。有一些可能的歐拉角定義,每個都可以依據 roll, pitch 和 yaw 的複合來表達。依據 "x-y-z" 歐拉角,在右手笛卡爾坐標中的旋轉矩陣可表達為:
![{\displaystyle {\mathcal {M}}(\alpha ,\beta ,\gamma )={\mathcal {R}}_{z}(\gamma ){\mathcal {R}}_{y}(\beta ){\mathcal {R}}_{x}(\alpha )}](//wikimedia.org/api/rest_v1/media/math/render/svg/7e18df6025a1721a9177048403249360ab088665)
進行乘法運算生成:
![{\displaystyle {\begin{aligned}{\mathcal {M}}(\alpha ,\beta ,\gamma )&={\begin{bmatrix}\cos \gamma &-\sin \gamma &0\\\sin \gamma &\cos \gamma &0\\0&0&1\end{bmatrix}}{\begin{bmatrix}\cos \beta &0&\sin \beta \\0&1&0\\-\sin \beta &0&\cos \beta \end{bmatrix}}{\begin{bmatrix}1&0&0\\0&\cos \alpha &-\sin \alpha \\0&\sin \alpha &\cos \alpha \end{bmatrix}}\\&={\begin{bmatrix}\cos \gamma \cos \beta &-\sin \gamma &\cos \gamma \sin \beta \\\sin \gamma \cos \beta &\cos \gamma &\sin \gamma \sin \beta \\-\sin \beta &0&\cos \beta \end{bmatrix}}{\begin{bmatrix}1&0&0\\0&\cos \alpha &-\sin \alpha \\0&\sin \alpha &\cos \alpha \end{bmatrix}}\\&={\begin{bmatrix}\cos \gamma \cos \beta &-\sin \gamma \cos \alpha +\cos \gamma \sin \beta \sin \alpha &\sin \gamma \sin \alpha +\cos \gamma \sin \beta \cos \alpha \\\sin \gamma \cos \beta &\cos \gamma \cos \alpha +\sin \gamma \sin \beta \sin \alpha &-\cos \gamma \sin \alpha +\sin \gamma \sin \beta \cos \alpha \\-\sin \beta &\cos \beta \sin \alpha &\cos \beta \cos \alpha \end{bmatrix}}\end{aligned}}}](//wikimedia.org/api/rest_v1/media/math/render/svg/9b06bc8fb70bb25db1fb9f09ae74d23b6066cd5a)
對旋轉軸
和旋轉角
,旋轉矩陣
![{\displaystyle {\mathcal {M}}=qq^{T}+QGQ^{T}}](//wikimedia.org/api/rest_v1/media/math/render/svg/1266c59627a57d05c1b03f970a678f46370224a1)
這裏的
的縱列張開正交於
的空間而
是
度 Givens 旋轉,就是說
![{\displaystyle G={\begin{bmatrix}\cos \theta &\sin \theta \\-\sin \theta &\cos \theta \end{bmatrix}}}](//wikimedia.org/api/rest_v1/media/math/render/svg/a530167c90fcf11c7c6da3b3c43cd105a224ce7f)
參見
外部連結