世界杯海报_u20世界杯德国 - jjswlx.com

坐标变换(5)—用旋转轴和旋转角表示旋转
2025-08-26 20:24:59

任何旋转,都可以用一个旋转轴ω^\hat \omegaω^和一个旋转角θ\thetaθ来描述。

1. 坐标系的线速度和角速度

如上图,在旋转的刚体上,附加一个body frame{b}\{b\}{b},记为{x^,y^,z^}\{\hat{x},\hat{y},\hat{z}\}{x^,y^​,z^}。对于三个轴而言,绕着ω^\hat \omegaω^旋转的轨迹为圆。当然,上述坐标轴{x^,y^,z^}\{\hat{x},\hat{y},\hat{z}\}{x^,y^​,z^}和ω^\hat \omegaω^是在fixed frame{S}\{S\}{S}坐标系下的,下面将ω^\hat \omegaω^记为ω^s\hat \omega_sω^s​,

绕着轴ω^\hat \omegaω^的角速度为,

ws=w^θ˙(1)

w_s=\hat{w}\dot{\theta} \tag{1}

ws​=w^θ˙(1)

运动的线速度记为x^˙\dot{\hat{x}}x^˙,三个轴的线速度则为,

x^˙=ws×x^y^˙=ws×y^z^˙=ws×z^(2)

\begin{aligned}

\dot{\hat{x}}&=w_s \times \hat{x} \\

\dot{\hat{y}}&=w_s \times \hat{y} \\

\dot{\hat{z}}&=w_s \times \hat{z}

\end{aligned} \tag{2}

x^˙y^​˙​z^˙​=ws​×x^=ws​×y^​=ws​×z^​(2)

将三个轴的线速度统一写为,

R˙=[ws×x^ws×y^ws×z^]=ws×R(3)

\dot{R}=

\begin{bmatrix}

w_s \times \hat{x} & w_s \times \hat{y} & w_s \times \hat{z}

\end{bmatrix}=w_s \times R \tag{3}

R˙=[ws​×x^​ws​×y^​​ws​×z^​]=ws​×R(3)

为了简化公式(3)中的叉乘,特引入了[][][]符号,将w×Rw \times Rw×R可以记为矩阵的乘法[w]R[w]R[w]R,其中[w][w][w]的定义如下:

对于R3\mathbb{R}^3R3中的向量x=[x1x2x3]x=\begin{bmatrix}x_1 & x_2 &x_3\end{bmatrix}x=[x1​​x2​​x3​​],定义[x][x][x]为一个反对称矩阵,

[x]=[0−x3x2x30−x1−x2x10](4)[x]=\left[\begin{array}{ccc}

0 & -x_{3} & x_{2} \\

x_{3} & 0 & -x_{1} \\

-x_{2} & x_{1} & 0

\end{array}\right]\tag{4}

[x]=⎣⎡​0x3​−x2​​−x3​0x1​​x2​−x1​0​⎦⎤​(4)

[x]=−[x]T(5)

[x]=-[x]^T \tag{5}

[x]=−[x]T(5)

上述所有3×33 \times 33×3的反对称矩阵统称为so(3)so(3)so(3),小的。前面说过,旋转矩阵属于SO(3)SO(3)SO(3),大的。下面有一个两者结合起来有趣的性质,假定riTr_i^TriT​为RRR的第iii行,即rir_iri​是RTR^TRT的第iii列,则

R[w]RT=R[ws×r1ws×r2ws×r3]=[r1T(ws×r1)r1T(ws×r2)r1T(ws×r3)r2T(ws×r1)r2T(ws×r2)r2T(ws×r3)r3T(ws×r1)r3T(ws×r2)r3T(ws×r3)]=[0−r3Twsr2Twsr3Tws0−r1Tws−r2Twsr1Tws0]=[Rws](6)

\begin{aligned}

R[w]R^T &= R\begin{bmatrix} w_s\times r_1 & w_s\times r_2 &w_s\times r_3 \end{bmatrix}\\

&= \begin{bmatrix}

r_1^{T}(w_s\times r_1) & r_1^T(w_s\times r_2) & r_1^T (w_s\times r_3) \\

r_2^{T}(w_s\times r_1) & r_2^T(w_s\times r_2) & r_2^T (w_s\times r_3) \\

r_3^{T}(w_s\times r_1) & r_3^T(w_s\times r_2) & r_3^T (w_s\times r_3)

\end{bmatrix} \\

&= \begin{bmatrix}

0 & -r_3^Tw_s & r_2^Tw_s\\

r_3^Tw_s & 0 &-r_1^Tw_s\\

-r_2^Tw_s&r_1^Tw_s&0

\end{bmatrix}\\

&=[Rw_s]

\end{aligned} \tag{6}

R[w]RT​=R[ws​×r1​​ws​×r2​​ws​×r3​​]=⎣⎡​r1T​(ws​×r1​)r2T​(ws​×r1​)r3T​(ws​×r1​)​r1T​(ws​×r2​)r2T​(ws​×r2​)r3T​(ws​×r2​)​r1T​(ws​×r3​)r2T​(ws​×r3​)r3T​(ws​×r3​)​⎦⎤​=⎣⎡​0r3T​ws​−r2T​ws​​−r3T​ws​0r1T​ws​​r2T​ws​−r1T​ws​0​⎦⎤​=[Rws​]​(6)

对于(6)中矩阵中的r1T(ws×r2)r_1^{T}(w_s\times r_2)r1T​(ws​×r2​),是三个向量r1,ws,r2r_1,w_s,r_2r1​,ws​,r2​的混合积,也就是三个向量组成的六面体的体积,而我们知道矩阵的行列式的值的物理意义就是体积。根据下面的混合积的图,很容易得到矩阵中对应元素的反对称的关系。

下面我们将三个轴的线速度表示为[w][w][w]的写法,

R˙=[ws]R(7)

\dot{R}=[w_s]R \tag{7}

R˙=[ws​]R(7)

[ws]=R˙R−1(8)

[w_s]=\dot{R}R^{-1} \tag{8}

[ws​]=R˙R−1(8)

前面我们提到的所有的向量和RRR都是在fixed frame{S}\{S\}{S}下描述的,下面我们将wsw_sws​在body frame{b}\{b\}{b}下进行描述,易得,

ws=Rsbwb(9)

w_s=R_{sb}w_b\tag{9}

ws​=Rsb​wb​(9)

则旋转轴在body frame{b}\{b\}{b}下,

wb=Rsb−1ws=R−1ws=RTws(10)

w_b=R_{sb}^{-1}w_s=R^{-1}w_s=R^{T}w_s \tag{10}

wb​=Rsb−1​ws​=R−1ws​=RTws​(10)

因此可以得到,

[wb]=[RTws]=RT[ws]R=RT(R˙RT)R=RTR˙=R−1R˙(11)

\begin{aligned}

[w_b]&=[R^{T}w_s] \\

&= R^T[w_s]R \\

&= R^T(\dot{R}R^{T})R \\

&=R^T\dot{R} \\

&=R^{-1}\dot{R}

\end{aligned}\tag{11}

[wb​]​=[RTws​]=RT[ws​]R=RT(R˙RT)R=RTR˙=R−1R˙​(11)

需要注意的是wbw_bwb​是在body frame{b}\{b\}{b}下的描述,所以它描述的角速度不是一个旋转的坐标系的角速度(例如{b}\{b\}{b}相对于{S}\{S\}{S}旋转),而是在某一瞬时,wbw_bwb​相对于body frame{b}\{b\}{b}的旋转。

2. 微分方程的解

给定下面一个简单的线性微分方程,其中x(t)∈Rx(t) \in \mathbb{R}x(t)∈R,a∈Ra \in \mathbb{R}a∈R,初始状态x(t)=x(0)x(t) =x(0)x(t)=x(0),

x˙(t)=ax(t)(12)

\dot x(t)=ax(t) \tag{12}

x˙(t)=ax(t)(12)

易得上述的解为,

x(t)=eatx(0)(13)

x(t)=e^{at}x(0) \tag{13}

x(t)=eatx(0)(13)

对eate^{at}eat在000附近进行泰勒展开,可得,

eat=1+at+(at)22!+(at)33!+⋯(14)

e^{a t}=1+a t+\frac{(a t)^{2}}{2 !}+\frac{(a t)^{3}}{3 !}+\cdots \tag{14}

eat=1+at+2!(at)2​+3!(at)3​+⋯(14)

同理,当aaa为矩阵AAA时,x(t)x(t)x(t)为列向量,

x˙(t)=Ax(t)(15)

\dot x(t)=Ax(t) \tag{15}

x˙(t)=Ax(t)(15)

可得解为,

x(t)=eAtx(0)(16)

x(t)=e^{At}x(0) \tag{16}

x(t)=eAtx(0)(16)

其中,

eAt=1+At+(At)22!+(At)33!+⋯(17)

e^{A t}=1+A t+\frac{(A t)^{2}}{2 !}+\frac{(A t)^{3}}{3 !}+\cdots \tag{17}

eAt=1+At+2!(At)2​+3!(At)3​+⋯(17)

3. 指数形式的旋转

任何旋转,都可以用一个旋转轴ω^\hat \omegaω^和一个旋转角θ\thetaθ来描述。其中ω^∈R3,∥ω^∥=1\hat \omega \in \mathbb{R^3},\Vert{\hat \omega}\Vert=1ω^∈R3,∥ω^∥=1,θ∈R3\theta \in \mathbb{R^3}θ∈R3。

下面我们来分析如何利用一根旋转轴和旋转角来描述旋转,

假设向量p(t)p(t)p(t)从p(0)p(0)p(0)绕着ω^\hat{\omega}ω^以恒定的角速度1rad/s1rad/s1rad/s旋转了θ\thetaθ秒,最终到p(θ)p(\theta)p(θ),定义p(t)p(t)p(t)间断的线速度为,

p˙=ω^×p(18)

\dot{p}= \hat{\omega} \times p \tag{18}

p˙​=ω^×p(18)

由前面的分析,引入[ω^][\hat{\omega}][ω^],则

p˙=[ω^]p(19)

\dot{p}= [\hat{\omega}] p \tag{19}

p˙​=[ω^]p(19)

该微分方程如前面介绍为,

p(t)=e[ω^]tp(0)(20)

p(t)=e^{[\hat{\omega}] t} p(0) \tag{20}

p(t)=e[ω^]tp(0)(20)

则,

p(θ)=e[ω^]θp(0)(21)

p(\theta)=e^{[\hat{\omega}] \theta} p(0) \tag{21}

p(θ)=e[ω^]θp(0)(21)

容易得到[ω^][\hat{\omega}][ω^]两个计算性质,如下,

[ω^][ω^]=ω^ω^T−I(22)

[\hat{\omega}][\hat{\omega}]=\hat{\omega}\hat{\omega}^{T}-I \tag{22}

[ω^][ω^]=ω^ω^T−I(22)

[ω^][ω^][ω^]=[ω^]3=−[ω^](23)

[\hat{\omega}][\hat{\omega}][\hat{\omega}]= [\hat{\omega}]^{3}=-[\hat{\omega}] \tag{23}

[ω^][ω^][ω^]=[ω^]3=−[ω^](23)

所以公式21可以化简为,

e[ω^]θ=I+[ω^]θ+[ω^]2θ22!+[ω^]3θ33!+⋯=I+(θ−θ33!+θ55!−⋯ )[ω^]+(θ22!−θ44!+θ66!−⋯ )[ω^]2=I+sin(θ)[ω^]+(1−cos(θ))[ω^]2(24)

\begin{aligned}

e^{[\hat{\omega}] \theta} &=I+[\hat{\omega}] \theta+[\hat{\omega}]^{2} \frac{\theta^{2}}{2 !}+[\hat{\omega}]^{3} \frac{\theta^{3}}{3 !}+\cdots \\

&=I+\left(\theta-\frac{\theta^{3}}{3 !}+\frac{\theta^{5}}{5 !}-\cdots\right)[\hat{\omega}]+\left(\frac{\theta^{2}}{2 !}-\frac{\theta^{4}}{4 !}+\frac{\theta^{6}}{6 !}-\cdots\right)[\hat{\omega}]^{2} \\

&= I+sin(\theta)[\hat{\omega}]+(1-cos(\theta))[\hat{\omega}]^{2}

\end{aligned} \tag{24}

e[ω^]θ​=I+[ω^]θ+[ω^]22!θ2​+[ω^]33!θ3​+⋯=I+(θ−3!θ3​+5!θ5​−⋯)[ω^]+(2!θ2​−4!θ4​+6!θ6​−⋯)[ω^]2=I+sin(θ)[ω^]+(1−cos(θ))[ω^]2​(24)

上式就是著名的罗德里格斯公式,即指数形式的旋转,

Rot⁡(ω^,θ)=e[ω^]θ=I+sin⁡θ[ω^]+(1−cos⁡θ)[ω^]2∈SO(3)(25)

\operatorname{Rot}(\hat{\omega}, \theta)=e^{[\hat{\omega}] \theta}=I+\sin \theta[\hat{\omega}]+(1-\cos \theta)[\hat{\omega}]^{2} \in S O(3) \tag{25}

Rot(ω^,θ)=e[ω^]θ=I+sinθ[ω^]+(1−cosθ)[ω^]2∈SO(3)(25)

经过指数映射,将so(3)s o(3)so(3)和旋转的角度θ\thetaθ通过指数映射为SO(3)S O(3)SO(3),即三维的旋转矩阵。

在前面文章中介绍过,旋转矩阵左乘和右乘的区别,这里也是类似的,假设body frame{b}\{b\}{b}在fixed frame{S}\{S\}{S}中的描述为RsbR_{sb}Rsb​,则Rot⁡(ω^,θ)Rsb\operatorname{Rot}(\hat{\omega}, \theta)R_{sb}Rot(ω^,θ)Rsb​,左乘,表示将RsbR_{sb}Rsb​顺着{S}\{S\}{S}中的ω^\hat{\omega}ω^旋转θ\thetaθ。而RsbRot⁡(ω^,θ)R_{sb}\operatorname{Rot}(\hat{\omega}, \theta)Rsb​Rot(ω^,θ),右乘,表示将RsbR_{sb}Rsb​顺着{b}\{b\}{b}中的ω^\hat{\omega}ω^旋转θ\thetaθ。

4. 旋转矩阵的对数

上面描述的是从ω^θ\hat{\omega}\thetaω^θ到旋转矩阵RRR的过程,下面介绍从旋转矩阵RRR求ω^θ\hat{\omega}\thetaω^θ的过程,也就是求得旋转向量和具体的旋转角度,求RRR矩阵的“对数”。可以将两个对应的过程描述成下面的形式,

exp⁡:[ω^]θ∈so(3)→R∈SO(3)log⁡:R∈SO(3)→[ω^]θ∈so⁡(3)

\begin{array}{cll}

\exp : & [\hat{\omega}] \theta \in s o(3) & \rightarrow & R \in S O(3) \\

\log : & R \in S O(3) & \rightarrow & [\hat{\omega}] \theta \in \operatorname{so}(3)

\end{array}

exp:log:​[ω^]θ∈so(3)R∈SO(3)​→→​R∈SO(3)[ω^]θ∈so(3)​

下面将公式(25)展开,如下,

[cθ+ω^12(1−cθ)ω^1ω^2(1−cθ)−ω^3sθω^1ω^3(1−cθ)+ω^2sθω^1ω^2(1−cθ)+ω^3Sθcθ+ω^22(1−cθ)ω^2ω^3(1−cθ)−ω^1sθω^1ω^3(1−cθ)−ω^2Sθω^2ω^3(1−cθ)+ω^1sθcθ+ω^32(1−cθ)](26)

\left[\begin{array}{ccc}

c_{\theta}+\hat{\omega}_{1}^{2}\left(1-c_{\theta}\right) & \hat{\omega}_{1} \hat{\omega}_{2}\left(1-c_{\theta}\right)-\hat{\omega}_{3} \mathrm{s}_{\theta} & \hat{\omega}_{1} \hat{\omega}_{3}\left(1-c_{\theta}\right)+\hat{\omega}_{2} \mathrm{s}_{\theta} \\

\hat{\omega}_{1} \hat{\omega}_{2}\left(1-\mathrm{c}_{\theta}\right)+\hat{\omega}_{3} \mathrm{S}_{\theta} & c_{\theta}+\hat{\omega}_{2}^{2}\left(1-c_{\theta}\right) & \hat{\omega}_{2} \hat{\omega}_{3}\left(1-\mathrm{c}_{\theta}\right)-\hat{\omega}_{1} \mathrm{s}_{\theta} \\

\hat{\omega}_{1} \hat{\omega}_{3}\left(1-\mathrm{c}_{\theta}\right)-\hat{\omega}_{2} \mathrm{S}_{\theta} & \hat{\omega}_{2} \hat{\omega}_{3}\left(1-\mathrm{c}_{\theta}\right)+\hat{\omega}_{1} \mathrm{s}_{\theta} & \mathrm{c}_{\theta}+\hat{\omega}_{3}^{2}\left(1-\mathrm{c}_{\theta}\right)

\end{array}\right] \tag{26}

⎣⎡​cθ​+ω^12​(1−cθ​)ω^1​ω^2​(1−cθ​)+ω^3​Sθ​ω^1​ω^3​(1−cθ​)−ω^2​Sθ​​ω^1​ω^2​(1−cθ​)−ω^3​sθ​cθ​+ω^22​(1−cθ​)ω^2​ω^3​(1−cθ​)+ω^1​sθ​​ω^1​ω^3​(1−cθ​)+ω^2​sθ​ω^2​ω^3​(1−cθ​)−ω^1​sθ​cθ​+ω^32​(1−cθ​)​⎦⎤​(26)

其中,ω^=[w1^w2^w3^]\hat{\omega} = \begin{bmatrix} \hat{w_1} \\ \hat{w_2} \\ \hat{w_3} \end{bmatrix}ω^=⎣⎡​w1​^​w2​^​w3​^​​⎦⎤​,cθ=cos(θ)\mathrm{c}_{\theta}=cos(\theta)cθ​=cos(θ),sθ=sin(θ)\mathrm{s}_{\theta}=sin(\theta)sθ​=sin(θ)。

记旋转矩阵RRR为rijr_{ij}rij​,则可以得到,

r32−r23=2ω^1sin(θ)r13−r31=2ω^2sin(θ)r21−r12=2ω^3sin(θ)(27)

\begin{aligned}

r_{32}-r_{23}&=2 \hat{\omega}_{1}sin(\theta) \\

r_{13}-r_{31}&=2 \hat{\omega}_{2}sin(\theta) \\

r_{21}-r_{12}&=2 \hat{\omega}_{3}sin(\theta)

\end{aligned} \tag{27}

r32​−r23​r13​−r31​r21​−r12​​=2ω^1​sin(θ)=2ω^2​sin(θ)=2ω^3​sin(θ)​(27)

上式在sin(θ)≠0sin(\theta)\ne 0sin(θ)​=0的情况下,可以得到,

ω^1=12sin(θ)(r32−r23)ω^2=12sin(θ)(r13−r31)ω^3=12sin(θ)(r21−r12)(28)

\begin{aligned}

\hat{\omega}_{1}=\frac{1}{2sin(\theta)}(r_{32}-r_{23}) \\

\hat{\omega}_{2}=\frac{1}{2sin(\theta)}(r_{13}-r_{31}) \\

\hat{\omega}_{3}=\frac{1}{2sin(\theta)}(r_{21}-r_{12})

\end{aligned} \tag{28}

ω^1​=2sin(θ)1​(r32​−r23​)ω^2​=2sin(θ)1​(r13​−r31​)ω^3​=2sin(θ)1​(r21​−r12​)​(28)

上式也可以写成,

[ω^]=[0−ω^3ω^2ω^30−ω^1−ω^2ω^10]=12sin⁡θ(R−RT)(29)

[\hat{\omega}]=\left[\begin{array}{ccc}

0 & -\hat{\omega}_{3} & \hat{\omega}_{2} \\

\hat{\omega}_{3} & 0 & -\hat{\omega}_{1} \\

-\hat{\omega}_{2} & \hat{\omega}_{1} & 0

\end{array}\right]=\frac{1}{2 \sin \theta}\left(R-R^{\mathrm{T}}\right) \tag{29}

[ω^]=⎣⎡​0ω^3​−ω^2​​−ω^3​0ω^1​​ω^2​−ω^1​0​⎦⎤​=2sinθ1​(R−RT)(29)

此外,由式(26)可以得到另外一个计算θ\thetaθ的公式,

tr⁡R=r11+r22+r33=1+2cos⁡θ(30)

\operatorname{tr} R=r_{11}+r_{22}+r_{33}=1+2 \cos \theta \tag{30}

trR=r11​+r22​+r33​=1+2cosθ(30)

至此,sin(θ)≠0sin(\theta)\ne 0sin(θ)​=0的情况下,利用旋转矩阵RRR,我们计算出了ω^\hat{\omega}ω^和θ\thetaθ。接下来讨论sin(θ)=0sin(\theta) = 0sin(θ)=0的情况:

当θ=kπ\theta=k\piθ=kπ,且kkk是偶数的情况下,此时相当于没有旋转,回到了原位置,R=IR=IR=I;当θ=kπ\theta=k\piθ=kπ,且kkk是奇数的情况下,此时有,

R=e[ω^]π=I+2[ω^]2(31)

R=e^{[\hat{\omega}] \pi}=I+2[\hat{\omega}]^{2} \tag{31}

R=e[ω^]π=I+2[ω^]2(31)

因为式(31)三个矩阵都是对角矩阵,所以可以得到下面的结果(利用RRR对角元素)

ω^i=±rii+12,i=1,2,3(32)

\hat{\omega}_{i}=\pm \sqrt{\frac{r_{i i}+1}{2}}, \quad i=1,2,3 \tag{32}

ω^i​=±2rii​+1​​,i=1,2,3(32)

利用RRR非对角元素,可得,

2ω^1ω^2=r122ω^2ω^3=r232ω^1ω^3=r13(33)

\begin{aligned}

2 \hat{\omega}_{1} \hat{\omega}_{2} &=r_{12} \\

2 \hat{\omega}_{2} \hat{\omega}_{3} &=r_{23} \\

2 \hat{\omega}_{1} \hat{\omega}_{3} &=r_{13}

\end{aligned} \tag{33}

2ω^1​ω^2​2ω^2​ω^3​2ω^1​ω^3​​=r12​=r23​=r13​​(33)

利用式(32)和式(33)我们就能计算出ω^\hat{\omega}ω^,同时此时旋转的角为θ=±π,±3π,…\theta=\pm \pi, \pm 3 \pi, \ldotsθ=±π,±3π,…。

从上面的计算过程很容易看出来,旋转角度是以2π2\pi2π为周期,其实也是符合物理意义的,旋转π\piπ和旋转3π3\pi3π的效果是一样的,因此我们可以将旋转的角度限定在[−π,π][-\pi,\pi][−π,π]。此时计算的ω^θ\hat{\omega}\thetaω^θ的长度是≤π\le\pi≤π的。因此我们可以把SO(3)S O (3)SO(3)想象为一个半径为π\piπ的实心球,如下图所示,

当给定球中的一点r∈R3r\in\mathbb{R}^3r∈R3,我们可以将ω^=r∥r∥\hat{\omega}=\frac{r}{\Vert r\Vert}ω^=∥r∥r​作为单位长度的旋转轴,∥r∥\Vert r\Vert∥r∥作为θ\thetaθ。和rrr相对应的旋转矩阵RRR可以被看作是绕着ω^\hat{\omega}ω^旋转了θ\thetaθ角。对于R∈SO(3)R\in SO(3)R∈SO(3),同时trR≠−1trR \ne -1trR​=−1,此时在实心球中总能找到一个唯一的rrr,使得e[r]=Re^{[r]}=Re[r]=R。当trR=−1trR = -1trR=−1时,此时∥r∥=π\Vert r\Vert=\pi∥r∥=π,在实心球的表面有一对正好相反的一对点,两者的效果是一样的,rrr和−r-r−r都对应了同一个RRR。