所有观点参见 秦永元 教授的 《惯性导航》书第6页,书中的旋转矩阵为右乘矩阵(坐标变换时候,向量在旋转矩阵右侧,旋转矩阵在向量的左侧:b = R * a)。
以东北天参考系为例则:
旋转的顺序为先绕 Z轴 (角度北偏东为正)旋转:
C n 1 = C g 1 = [ cos Ψ − sin Ψ 0 sin Ψ cos Ψ 0 0 0 1 ] \boldsymbol{C}_{n}^{1}=\boldsymbol{C}_{\mathrm{g}}^{1}=\left[\begin{array}{ccc} \cos \Psi & -\sin \Psi & 0 \\ \sin \Psi & \cos \Psi & 0 \\ 0 & 0 & 1 \end{array}\right] Cn1=Cg1=⎣⎡cosΨsinΨ0−sinΨcosΨ0001⎦⎤
再绕 X轴 旋转(Y->Z 为正),最后绕 Y轴 旋转(Z->X 为正)。
C 1 b = C 2 b C 1 2 = [ cos γ 0 − sin γ 0 1 0 sin γ 0 cos γ ] [ 1 0 0 0 cos θ sin θ 0 − sin θ cos θ ] = [ cos γ sin θ sin γ − cos θ sin γ 0 cos θ sin θ sin γ − sin θ cos γ cos θ cos γ ] \begin{aligned} \boldsymbol{C}_{1}^{b} &=\boldsymbol{C}_{2}^{b} \boldsymbol{C}_{1}^{2}=\left[\begin{array}{ccc} \cos \gamma & 0 & -\sin \gamma \\ 0 & 1 & 0 \\ \sin \gamma & 0 & \cos \gamma \end{array}\right]\left[\begin{array}{ccc} 1 & 0 & 0 \\ 0 & \cos \theta & \sin \theta \\ 0 & -\sin \theta & \cos \theta \end{array}\right] \\ &=\left[\begin{array}{ccc} \cos \gamma & \sin \theta \sin \gamma & -\cos \theta \sin \gamma \\ 0 & \cos \theta & \sin \theta \\ \sin \gamma & -\sin \theta \cos \gamma & \cos \theta \cos \gamma \end{array}\right] \end{aligned} C1b=C2bC12=⎣⎡cosγ0sinγ010−sinγ0cosγ⎦⎤⎣⎡1000cosθ−sinθ0sinθcosθ⎦⎤=⎣⎡cosγ0sinγsinθsinγcosθ−sinθcosγ−cosθsinγsinθcosθcosγ⎦⎤
n系到b系的旋转矩阵为:
C n b = C 1 b ⋅ C n 1 = [ cos γ cos Ψ + sin γ sin Ψ sin θ − cos γ sin Ψ + sin γ cos Ψ sin θ − sin γ cos θ sin Ψ cos θ cos Ψ cos θ sin θ sin γ cos Ψ − cos γ sin Ψ sin θ − sin γ sin Ψ − cos γ cos Ψ sin θ cos γ cos θ ] \begin{aligned} \boldsymbol{C}_{n}^{b} &=\boldsymbol{C}_{1}^{b} \cdot \boldsymbol{C}_{n}^{1} \\ &=\left[\begin{array}{ccc} \cos \gamma_{\cos } \Psi+\sin \gamma_{\sin } \Psi \sin \theta & -\cos \gamma_{\sin } \Psi+\sin \gamma_{\cos } \Psi \sin \theta & -\sin \gamma_{\cos \theta} \\ \sin \Psi \cos \theta & \cos \Psi \cos \theta & \sin \theta \\ \sin \gamma_{\cos } \Psi-\cos \gamma_{\sin } \Psi \sin \theta & -\sin \gamma \sin \Psi-\cos \gamma_{\cos } \Psi \sin \theta & \cos \gamma_{\cos \theta} \end{array}\right] \end{aligned} Cnb=C1b⋅Cn1=⎣⎡cosγcosΨ+sinγsinΨsinθsinΨcosθsinγcosΨ−cosγsinΨsinθ−cosγsinΨ+sinγcosΨsinθcosΨcosθ−sinγsinΨ−cosγcosΨsinθ−sinγcosθsinθcosγcosθ⎦⎤
旋转矩阵是一个正交矩阵:
C b n = ( C n b ) − 1 = ( C n b ) T \boldsymbol{C}_{b}^{n}=\left(\boldsymbol{C}_{n}^{b}\right)^{-1}=\left(\boldsymbol{C}_{n}^{b}\right)^{\mathrm{T}} Cbn=(Cnb)−1=(Cnb)T
两个坐标系的正反转换可以用旋转矩阵和旋转矩阵的转置表示:
C n b = ( C b n ) T = [ T 11 T 21 T 31 T 12 T 22 T 32 T 13 T 23 T 33 ] \boldsymbol{C}_{n}^{b}=\left(\boldsymbol{C}_{b}^{n}\right)^{\mathrm{T}}=\left[\begin{array}{lll} T_{11} & T_{21} & T_{31} \\ T_{12} & T_{22} & T_{32} \\ T_{13} & T_{23} & T_{33} \end{array}\right] Cnb=(Cbn)T=⎣⎡T11T12T13T21T22T23T31T32T33⎦⎤
如果记:
C b n = [ T 11 T 12 T 13 T 21 T 22 T 23 T 31 T 32 T 33 ] \boldsymbol{C}_{b}^{n}=\left[\begin{array}{lll} T_{11} & T_{12} & T_{13} \\ T_{21} & T_{22} & T_{23} \\ T_{31} & T_{32} & T_{33} \end{array}\right] Cbn=⎣⎡T11T21T31T12T22T32T13T23T33⎦⎤
则:
C n b = ( C b n ) T = [ T 11 T 21 T 31 T 12 T 22 T 32 T 13 T 23 T 33 ] \boldsymbol{C}_{n}^{b}=\left(\boldsymbol{C}_{b}^{n}\right)^{\mathrm{T}}=\left[\begin{array}{lll} T_{11} & T_{21} & T_{31} \\ T_{12} & T_{22} & T_{32} \\ T_{13} & T_{23} & T_{33} \end{array}\right] Cnb=(Cbn)T=⎣⎡T11T12T13T21T22T23T31T32T33⎦⎤
所以有( γ \gamma γ和 Ψ \Psi Ψ取值要根据象限来定):
{ θ = arcsin ( T 32 ) γ 主 = arctan ( − T 31 T 33 ) Ψ 主 = arctan ( T 12 T 22 ) \left\{\begin{array}{l} \theta=\arcsin \left(T_{32}\right) \\ \gamma_{\text {主 }}=\arctan \left(-\frac{T_{31}}{T_{33}}\right) \\ \Psi_{\text {主 }}=\arctan \left(\frac{T_{12}}{T_{22}}\right) \end{array}\right. ⎩⎪⎪⎨⎪⎪⎧θ=arcsin(T32)γ主 =arctan(−T33T31)Ψ主 =arctan(T22T12)
T 22 T 12 Ψ → 0 + 9 0 ∘ → 0 − − 9 0 ∘ + + Ψ 主 + − Ψ 主 − + Ψ 主 + 18 0 ∘ − − Ψ 主 − 18 0 ∘ \begin{array}{|c|c|c|} \hline T_{22} & T_{12} & \Psi \\ \hline \rightarrow 0 & + & 90^{\circ} \\ \hline \rightarrow 0 & - & -90^{\circ} \\ \hline+ & + & \Psi_{\text {主 }} \\ \hline+ & - & \Psi_{\text {主 }} \\ \hline- & + & \Psi_{\text {主 }}+180^{\circ} \\ \hline- & - & \Psi_{\text {主 }}-180^{\circ} \\ \hline \end{array} T22→0→0++−−T12+−+−+−Ψ90∘−90∘Ψ主 Ψ主 Ψ主 +180∘Ψ主 −180∘
γ 主 T 33 γ + − + γ 主 + − γ 主 − 18 0 ∘ − − γ 主 + 18 0 ∘ \begin{array}{|c|c|c|} \hline \gamma_{\text {主 }} & T_{\mathrm{3} 3} & \gamma \\ \hline+ & & \\ \hline- & + & \gamma_{\text {主 }} \\ \hline+ & - & \gamma_{\text {主 }}-180^{\circ} \\ \hline- & - & \gamma_{\text {主 }}+180^{\circ} \\ \hline \end{array} γ主 +−+−T33+−−γγ主 γ主 −180∘γ主 +180∘
Matlab 符号计算与计算结果(与书中给出的一致):
clear all;
clc;
syms cosF sinF cosT sinT cosR sinR;
%% 东北天坐标系 (秦永元《惯性导航》 P6)
% ① 绕 Z 轴旋转R角,Y->X 为正 (角度北偏东为正)
C_n_1 = [cosF -sinF 0;
sinF cosF 0;
0 0 1];
% ② 绕 X 轴旋转R角,Y->Z 为正
C_1_2 = [1 0 0;
0 cosT sinT;
0 -sinT cosT];
% ③ 绕 Y 轴旋转R角,Z->X 为正
C_2_b = [cosR 0 -sinR;
0 1 0;
sinR 0 cosR];
C_n_b = C_2_b*C_1_2*C_n_1;
disp(C_n_b);
旋转矩阵计算结果:
[ cosF*cosR + sinF*sinR*sinT, cosF*sinR*sinT - cosR*sinF, -cosT*sinR]
[ cosT*sinF, cosF*cosT, sinT]
[ cosF*sinR - cosR*sinF*sinT, - sinF*sinR - cosF*cosR*sinT, cosR*cosT]
四元数表示旋转矩阵:《惯性导航》
{ q 0 = cos θ 2 q 1 = l sin θ 2 q 2 = m sin θ 2 q 3 = n sin θ 2 \left\{\begin{array}{l} q_{0}=\cos \frac{\theta}{2} \\ q_{1}=l \sin \frac{\theta}{2} \\ q_{2}=m \sin \frac{\theta}{2} \\ q_{3}=n \sin \frac{\theta}{2} \end{array}\right. ⎩⎪⎪⎨⎪⎪⎧q0=cos2θq1=lsin2θq2=msin2θq3=nsin2θ
旋转矩阵用四元数可以描述为(转轴为u = { l,m,n },旋转角度为 θ \theta θ):
C b R = [ 1 − 2 ( q 2 2 + q 3 2 ) 2 ( q 1 q 2 − q 0 q 3 ) 2 ( q 1 q 3 + q 0 q 2 ) 2 ( q 1 q 2 + q 0 q 3 ) 1 − 2 ( q 1 2 + q 3 2 ) 2 ( q 2 q 3 − q 0 q 1 ) 2 ( q 1 q 3 − q 0 q 2 ) 2 ( q 2 q 3 + q 0 q 1 ) 1 − 2 ( q 1 2 + q 2 2 ) ] \boldsymbol{C}_{b}^{R}=\left[\begin{array}{ccc} 1-2\left(q_{2}^{2}+q_{3}^{2}\right) & 2\left(q_{1} q_{2}-q_{0} q_{3}\right) & 2\left(q_{1} q_{3}+q_{0} q_{2}\right) \\ 2\left(q_{1} q_{2}+q_{0} q_{3}\right) & 1-2\left(q_{1}^{2}+q_{3}^{2}\right) & 2\left(q_{2} q_{3}-q_{0} q_{1}\right) \\ 2\left(q_{1} q_{3}-q_{0} q_{2}\right) & 2\left(q_{2} q_{3}+q_{0} q_{1}\right) & 1-2\left(q_{1}^{2}+q_{2}^{2}\right) \end{array}\right] CbR=⎣⎡1−2(q22+q32)2(q1q2+q0q3)2(q1q3−q0q2)2(q1q2−q0q3)1−2(q12+q32)2(q2q3+q0q1)2(q1q3+q0q2)2(q2q3−q0q1)1−2(q12+q22)⎦⎤
同时四元数还可以这样描述旋转矩阵(向量 r b {r}^{b} rb旋转到 r R {r}^{R} rR):
r R = Q ⊗ r b ⊗ Q ∗ \boldsymbol{r}^{R}=\boldsymbol{Q} \otimes \boldsymbol{r}^{b} \otimes \boldsymbol{Q}^{*} rR=Q⊗rb⊗Q∗
Q ⊗ r b ⊗ Q ∗ = M ( Q ) M ′ ( Q ∗ ) [ 0 r b ] \boldsymbol{Q} \otimes \boldsymbol{r}^{b} \otimes \boldsymbol{Q}^{*}=\boldsymbol{M}(\boldsymbol{Q}) \boldsymbol{M}^{\prime}\left(\boldsymbol{Q}^{*}\right)\left[\begin{array}{l} 0 \\ \boldsymbol{r}^{b} \end{array}\right] Q⊗rb⊗Q∗=M(Q)M′(Q∗)[0rb]
= [ q 0 − q 1 − q 2 − q 3 q 1 q 0 − q 3 q 2 q 2 q 3 q 0 − q 1 q 3 − q 2 q 1 q 0 ] [ q 0 q 1 q 2 q 3 − q 1 q 0 − q 3 q 2 − q 2 q 3 q 0 − q 1 − q 3 − q 2 q 1 q 0 ] [ 0 r x b r y b r z b ] =\left[\begin{array}{cccc} q_{0} & -q_{1} & -q_{2} & -q_{3} \\ q_{1} & q_{0} & -q_{3} & q_{2} \\ q_{2} & q_{3} & q_{0} & -q_{1} \\ q_{3} & -q_{2} & q_{1} & q_{0} \end{array}\right]\left[\begin{array}{cccc} q_{0} & q_{1} & q_{2} & q_{3} \\ -q_{1} & q_{0} & -q_{3} & q_{2} \\ -q_{2} & q_{3} & q_{0} & -q_{1} \\ -q_{3} & -q_{2} & q_{1} & q_{0} \end{array}\right]\left[\begin{array}{c} 0 \\ r_{x}^{b} \\ r_{y}^{b} \\ r_{z}^{b} \end{array}\right] =⎣⎢⎢⎡q0q1q2q3−q1q0q3−q2−q2−q3q0q1−q3q2−q1q0⎦⎥⎥⎤⎣⎢⎢⎡q0−q1−q2−q3q1q0q3−q2q2−q3q0q1q3q2−q1q0⎦⎥⎥⎤⎣⎢⎢⎡0rxbrybrzb⎦⎥⎥⎤
= [ × 0 0 0 × q 1 2 + q 0 2 − q 3 2 − q 2 2 2 ( q 1 q 2 − q 0 q 3 ) 2 ( q 1 q 3 + q 0 q 2 ) × 2 ( q 1 q 2 + q 0 q 3 ) q 2 2 − q 3 2 + q 0 2 − q 1 2 2 ( q 2 q 3 − q 0 q 1 ) × 2 ( q 1 q 3 − q 0 q 2 ) 2 ( q 2 q 3 + q 0 q 1 ) q 3 2 − q 2 2 − q 1 2 + q 0 2 ] [ 0 r x b r y b r z b ] =\left[\begin{array}{cccc} \times & 0 & 0 & 0 \\ \times & q_{1}^{2}+q_{0}^{2}-q_{3}^{2}-q_{2}^{2} & 2\left(q_{1} q_{2}-q_{0} q_{3}\right) & 2\left(q_{1} q_{3}+q_{0} q_{2}\right) \\ \times & 2\left(q_{1} q_{2}+q_{0} q_{3}\right) & q_{2}^{2}-q_{3}^{2}+q_{0}^{2}-q_{1}^{2} & 2\left(q_{2} q_{3}-q_{0} q_{1}\right) \\ \times & 2\left(q_{1} q_{3}-q_{0} q_{2}\right) & 2\left(q_{2} q_{3}+q_{0} q_{1}\right) & q_{3}^{2}-q_{2}^{2}-q_{1}^{2}+q_{0}^{2} \end{array}\right]\left[\begin{array}{c} 0 \\ r_{x}^{b} \\ r_{y}^{b} \\ r_{z}^{b} \end{array}\right] =⎣⎢⎢⎡××××0q12+q02−q32−q222(q1q2+q0q3)2(q1q3−q0q2)02(q1q2−q0q3)q22−q32+q02−q122(q2q3+q0q1)02(q1q3+q0q2)2(q2q3−q0q1)q32−q22−q12+q02⎦⎥⎥⎤⎣⎢⎢⎡0rxbrybrzb⎦⎥⎥⎤
(1)向量叉乘
设有:
r n = [ r x n r y n r z n ] T , s n = [ s x n s y n s z n ] T , t n = r n × s n \boldsymbol{r}^{n}=\left[\begin{array}{lll} r_{x}^{n} & r_{y}^{n} & r_{z}^{n} \end{array}\right]^{\mathrm{T}}, \boldsymbol{s}^{n}=\left[\begin{array}{lll} s_{x}^{n} & s_{y}^{n} & s_{z}^{n} \end{array}\right]^{\mathrm{T}}, \boldsymbol{t}^{n}=\boldsymbol{r}^{n} \times \boldsymbol{s}^{n} rn=[rxnrynrzn]T,sn=[sxnsynszn]T,tn=rn×sn
则:
[ t x n t y n t x n ] = [ 0 − r z n r y n r z n 0 − r x n − r y n r x n 0 ] [ s x n s y n s z n ] \left[\begin{array}{c} t_{x}^{n} \\ t_{y}^{n} \\ t_{x}^{n} \end{array}\right]=\left[\begin{array}{ccc} 0 & -r_{z}^{n} & r_{y}^{n} \\ r_{z}^{n} & 0 & -r_{x}^{n} \\ -r_{y}^{n} & r_{x}^{n} & 0 \end{array}\right]\left[\begin{array}{c} s_{x}^{n} \\ s_{y}^{n} \\ s_{z}^{n} \end{array}\right] ⎣⎡txntyntxn⎦⎤=⎣⎡0rzn−ryn−rzn0rxnryn−rxn0⎦⎤⎣⎡sxnsynszn⎦⎤
其中: t n = [ t x n t y n t z n ] T \boldsymbol{t}^{n}=\left[\begin{array}{lll} t_{x}^{n} & t_{y}^{n} & t_{z}^{n} \end{array}\right]^{\mathrm{T}} tn=[txntyntzn]T
(2)三重矢积:
u × ( u × r ) = u ( u ⋅ r ) − ( u ⋅ u ) r = ( r ⋅ u ) u − r \begin{aligned} \boldsymbol{u} \times(\boldsymbol{u} \times \boldsymbol{r}) &=\boldsymbol{u}(\boldsymbol{u} \cdot \boldsymbol{r})-(\boldsymbol{u} \cdot \boldsymbol{u}) \boldsymbol{r} \\ &=(\boldsymbol{r} \cdot \boldsymbol{u}) \boldsymbol{u}-\boldsymbol{r} \end{aligned} u×(u×r)=u(u⋅r)−(u⋅u)r=(r⋅u)u−r
哥氏定理用于描述绝对变化率与相对变化率间的关系。设有矢量 r r r, m m m 和 n n n 是两个作相对旋转的坐标系,则哥氏定理可描述为:
d r d t ∣ m = d r d t ∣ n + ω m n × r \left.\frac{\mathrm{d} \boldsymbol{r}}{\mathrm{d} t}\right|_{m}=\left.\frac{\mathrm{d} \boldsymbol{r}}{\mathrm{d} t}\right|_{n}+\omega_{m n} \times \boldsymbol{r} dtdr∣∣∣∣m=dtdr∣∣∣∣n+ωmn×r
其中: d r d t ∣ m 和 d r d t ∣ n \left.\frac{\mathrm{d} \boldsymbol{r}}{\mathrm{d} t}\right|_{m} \text {和}\left.\frac{\mathrm{d} \boldsymbol{r}}{\mathrm{d} t}\right|_{n} dtdr∣∣m和dtdr∣∣n是分别在 m m m 坐标系和 n n n 坐标系内观察到的 r \boldsymbol{r} r 的时间变化率 , ω m n , \omega_{m n} ,ωmn是坐标系 n 相对坐标系 m 的旋转角速度。如果将哥氏定理两边的矢量都向 m 坐 标系投影,则有:
r ˙ m = C n m r ˙ n + ω m n m × r m \dot{\boldsymbol{r}}^{m}=\boldsymbol{C}_{n}^{m} \dot{\boldsymbol{r}}^{n}+\omega_{m n}^{m} \times \boldsymbol{r}^{m} r˙m=Cnmr˙n+ωmnm×rm
其中:
r ˙ m = [ r ˙ x m r ˙ y m r ˙ z m ] T r ˙ n = [ r ˙ x n r ˙ y n r ˙ z n ] T \begin{aligned} \dot{r}^{m} &=\left[\begin{array}{lll} \dot{r}_{x}^{m} & \dot{r}_{y}^{m} & \dot{r}_{z}^{m} \end{array}\right]^{\mathrm{T}} \\ \dot{r}^{n} &=\left[\begin{array}{lll} \dot{r}_{x}^{n} & \dot{r}_{y}^{n} & \dot{r}_{z}^{n} \end{array}\right]^{\mathrm{T}} \end{aligned} r˙mr˙n=[r˙xmr˙ymr˙zm]T=[r˙xnr˙ynr˙zn]T
矢量式:
Q = q 0 + q \boldsymbol{Q}=q_{0}+\boldsymbol{q} Q=q0+q
指数式:
Q = e u θ 2 \boldsymbol{Q}=\mathrm{e}^{u \frac{\theta}{2}} Q=eu2θ
三角式:
Q = cos θ 2 + u sin θ 2 \boldsymbol{Q}=\cos \frac{\theta}{2}+\boldsymbol{u} \sin \frac{\theta}{2} Q=cos2θ+usin2θ
复数式:
Q = q 0 + q 1 i + q 2 j + q 3 k \boldsymbol{Q}=q_{0}+q_{1} \boldsymbol{i}+q_{2} \boldsymbol{j}+q_{3} \boldsymbol{k} Q=q0+q1i+q2j+q3k
Q ∗ = q 0 − q 1 i − q 2 j − q 3 k \boldsymbol{Q}^{*}=q_{0}-q_{1} \boldsymbol{i}-q_{2} \boldsymbol{j}-q_{3} \boldsymbol{k} Q∗=q0−q1i−q2j−q3k
矩阵式:
Q = [ q 0 q 1 q 2 q 3 ] \boldsymbol{Q}=\left[\begin{array}{l} q_{0} \\ q_{1} \\ q_{2} \\ q_{3} \end{array}\right] Q=⎣⎢⎢⎡q0q1q2q3⎦⎥⎥⎤
范数:(范数为1的四元数为规范四元数)
∥ Q ∥ = q 0 2 + q 1 2 + q 2 2 + q 3 2 \|\boldsymbol{Q}\|=q_{0}^{2}+q_{1}^{2}+q_{2}^{2}+q_{3}^{2} ∥Q∥=q02+q12+q22+q32
加减法:
Q = q 0 + q 1 i + q 2 j + q 3 k P = p 0 + p 1 i + p 2 j + p 3 k \begin{array}{l} \boldsymbol{Q}=q_{0}+q_{1} \boldsymbol{i}+q_{2} \boldsymbol{j}+q_{3} \boldsymbol{k} \\ \boldsymbol{P}=p_{0}+p_{1} \boldsymbol{i}+p_{2} \boldsymbol{j}+p_{3} \boldsymbol{k} \end{array} Q=q0+q1i+q2j+q3kP=p0+p1i+p2j+p3k
Q ± P = ( q 0 ± p 0 ) + ( q 1 ± p 1 ) i + ( q 2 ± p 2 ) j + ( q 3 ± p 3 ) k \boldsymbol{Q} \pm \boldsymbol{P}=\left(q_{0} \pm p_{0}\right)+\left(q_{1} \pm p_{1}\right) i+\left(q_{2} \pm p_{2}\right) \boldsymbol{j}+\left(q_{3} \pm p_{3}\right) \boldsymbol{k} Q±P=(q0±p0)+(q1±p1)i+(q2±p2)j+(q3±p3)k
乘法:
标量乘法: a Q = a q 0 + a q 1 i + a q 2 j + a q 3 k a Q=a q_{0}+a q_{1} i+a q_{2} j+a q_{3} k aQ=aq0+aq1i+aq2j+aq3k
四元数乘法: P ⊗ Q = ( p 0 + p 1 i + p 2 j + p 3 k ) ⊗ ( q 0 + q 1 i + q 2 j + q 3 k ) = ( p 0 q 0 − p 1 q 1 − p 2 q 2 − p 3 q 3 ) + ( p 0 q 1 + p 1 q 0 + p 2 q 3 − p 3 q 2 ) i + ( p 0 q 2 + p 2 q 0 + p 3 q 1 − p 1 q 3 ) j + ( p 0 q 3 + p 3 q 0 + p 1 q 2 − p 2 q 1 ) k \begin{aligned} \boldsymbol{P} \otimes \boldsymbol{Q}=&\left(p_{0}+p_{1} i+p_{2} \boldsymbol{j}+p_{3} \boldsymbol{k}\right) \otimes\left(q_{0}+q_{1} \boldsymbol{i}+q_{2} \boldsymbol{j}+q_{3} \boldsymbol{k}\right) \\ =&\left(p_{0} q_{0}-p_{1} q_{1}-p_{2} q_{2}-p_{3} q_{3}\right)+\left(p_{0} q_{1}+p_{1} q_{0}+p_{2} q_{3}-p_{3} q_{2}\right) \boldsymbol{i} \\ &+\left(p_{0} q_{2}+p_{2} q_{0}+p_{3} q_{1}-p_{1} q_{3}\right) \boldsymbol{j}+\left(p_{0} q_{3}+p_{3} q_{0}+p_{1} q_{2}-p_{2} q_{1}\right) \boldsymbol{k} \end{aligned} P⊗Q==(p0+p1i+p2j+p3k)⊗(q0+q1i+q2j+q3k)(p0q0−p1q1−p2q2−p3q3)+(p0q1+p1q0+p2q3−p3q2)i+(p0q2+p2q0+p3q1−p1q3)j+(p0q3+p3q0+p1q2−p2q1)k = r 0 + r 1 i + r 2 j + r 3 k =r_{0}+r_{1} i+r_{2} j+r_{3} k =r0+r1i+r2j+r3k
也可表示为: [ r 0 r 1 r 2 r 3 ] = [ p 0 − p 1 − p 2 − p 3 p 1 p 0 − p 3 p 2 p 2 p 3 p 0 − p 1 p 3 − p 2 p 1 p 0 ] [ q 0 q 1 q 2 q 3 ] = M ( P ) Q \left[\begin{array}{c} r_{0} \\ r_{1} \\ r_{2} \\ r_{3} \end{array}\right]=\left[\begin{array}{cccc} p_{0} & -p_{1} & -p_{2} & -p_{3} \\ p_{1} & p_{0} & -p_{3} & p_{2} \\ p_{2} & p_{3} & p_{0} & -p_{1} \\ p_{3} & -p_{2} & p_{1} & p_{0} \end{array}\right]\left[\begin{array}{c} q_{0} \\ q_{1} \\ q_{2} \\ q_{3} \end{array}\right]=M(P) Q ⎣⎢⎢⎡r0r1r2r3⎦⎥⎥⎤=⎣⎢⎢⎡p0p1p2p3−p1p0p3−p2−p2−p3p0p1−p3p2−p1p0⎦⎥⎥⎤⎣⎢⎢⎡q0q1q2q3⎦⎥⎥⎤=M(P)Q
[ r 0 r 1 r 2 r 3 ] = [ q 0 − q 1 − q 2 − q 3 q 1 q 0 q 3 − q 2 q 2 − q 3 q 0 q 1 q 3 q 2 − q 1 q 0 ] [ p 0 p 1 p 2 p 3 ] = M ′ ( Q ) P \left[\begin{array}{c} r_{0} \\ r_{1} \\ r_{2} \\ r_{3} \end{array}\right]=\left[\begin{array}{cccc} q_{0} & -q_{1} & -q_{2} & -q_{3} \\ q_{1} & q_{0} & q_{3} & -q_{2} \\ q_{2} & -q_{3} & q_{0} & q_{1} \\ q_{3} & q_{2} & -q_{1} & q_{0} \end{array}\right]\left[\begin{array}{c} p_{0} \\ p_{1} \\ p_{2} \\ p_{3} \end{array}\right]=M^{\prime}(\boldsymbol{Q}) \boldsymbol{P} ⎣⎢⎢⎡r0r1r2r3⎦⎥⎥⎤=⎣⎢⎢⎡q0q1q2q3−q1q0−q3q2−q2q3q0−q1−q3−q2q1q0⎦⎥⎥⎤⎣⎢⎢⎡p0p1p2p3⎦⎥⎥⎤=M′(Q)P
即是:
P ⊗ Q = M ( P ) Q P ⊗ Q = M ′ ( Q ) P \begin{array}{l} \boldsymbol{P} \otimes \boldsymbol{Q}=\boldsymbol{M}(\boldsymbol{P}) \boldsymbol{Q} \\ \boldsymbol{P} \otimes \boldsymbol{Q}=\boldsymbol{M}^{\prime}(\boldsymbol{Q}) \boldsymbol{P} \end{array} P⊗Q=M(P)QP⊗Q=M′(Q)P
分配律和结合律:(不满足交换律)
P ⊗ ( Q + R ) = P ⊗ Q + P ⊗ R P ⊗ Q ⊗ R = ( P ⊗ Q ) ⊗ R = P ⊗ ( Q ⊗ R ) \begin{array}{c} \boldsymbol{P} \otimes(\boldsymbol{Q}+\boldsymbol{R})=\boldsymbol{P} \otimes \boldsymbol{Q}+\boldsymbol{P} \otimes \boldsymbol{R} \\ \boldsymbol{P} \otimes \boldsymbol{Q} \otimes \boldsymbol{R}=(\boldsymbol{P} \otimes \boldsymbol{Q}) \otimes \boldsymbol{R}=\boldsymbol{P} \otimes(\boldsymbol{Q} \otimes \boldsymbol{R}) \end{array} P⊗(Q+R)=P⊗Q+P⊗RP⊗Q⊗R=(P⊗Q)⊗R=P⊗(Q⊗R)
四元数的逆:
P ⊗ P ∗ = ( p 0 + p 1 i + p 2 j + p 3 k ) ⊗ ( p 0 − p 1 i − p 2 j − p 3 k ) = p 0 2 + p 1 2 + p 2 2 + p 3 2 = ∥ P ∥ \begin{aligned} \boldsymbol{P} \otimes \boldsymbol{P}^{*} &=\left(p_{0}+p_{1} \boldsymbol{i}+p_{2} \boldsymbol{j}+p_{3} \boldsymbol{k}\right) \otimes\left(p_{0}-p_{1} \boldsymbol{i}-p_{2} \boldsymbol{j}-p_{3} \boldsymbol{k}\right) \\ &=p_{0}^{2}+p_{1}^{2}+p_{2}^{2}+p_{3}^{2} \\ &=\|\boldsymbol{P}\| \end{aligned} P⊗P∗=(p0+p1i+p2j+p3k)⊗(p0−p1i−p2j−p3k)=p02+p12+p22+p32=∥P∥
则: P − 1 = P ∗ ∥ P ∥ \boldsymbol{P}^{-1}=\frac{\boldsymbol{P}^{*}}{\|\boldsymbol{P}\|} P−1=∥P∥P∗
四元数微分:
[ q ˙ 0 q ˙ 1 q ˙ 2 q ˙ 3 ] = [ 0 − ω x − ω y − ω z ω x 0 ω z − ω y ω y − ω z 0 ω x ω z ω y − ω x 0 ] [ q 0 q 1 q 2 q 3 ] \left[\begin{array}{c} \dot{q}_{0} \\ \dot{q}_{1} \\ \dot{q}_{2} \\ \dot{q}_{3} \end{array}\right]=\left[\begin{array}{cccc} 0 & -\omega_{x} & -\omega_{y} & -\omega_{z} \\ \omega_{x} & 0 & \omega_{z} & -\omega_{y} \\ \omega_{y} & -\omega_{z} & 0 & \omega_{x} \\ \omega_{z} & \omega_{y} & -\omega_{x} & 0 \end{array}\right]\left[\begin{array}{c} q_{0} \\ q_{1} \\ q_{2} \\ q_{3} \end{array}\right] ⎣⎢⎢⎡q˙0q˙1q˙2q˙3⎦⎥⎥⎤=⎣⎢⎢⎡0ωxωyωz−ωx0−ωzωy−ωyωz0−ωx−ωz−ωyωx0⎦⎥⎥⎤⎣⎢⎢⎡q0q1q2q3⎦⎥⎥⎤