问题
对于三维空间中的任意向量 v v v绕旋转轴 k k k( k k k为单位向量)旋转 θ \theta θ弧度后的结果 v ′ v' v′
解
首先把向量 v v v分解为
- 与旋转轴 k k k垂直的向量 v 1 v_1 v1
- 与旋转轴 k k k平行的向量 v 2 v_2 v2
在旋转过程中,向量 v 2 v_2 v2不发生变化
因为
k
k
k为单位向量
所以
v
2
=
(
v
⋅
k
)
k
v_2 = (v\cdot k)k
v2=(v⋅k)k
因为
v
=
v
1
+
v
2
v= v_1+v_2
v=v1+v2
所以
v
1
=
v
−
v
2
=
v
−
(
v
⋅
k
)
k
v_1=v- v_2 = v- (v\cdot k)k
v1=v−v2=v−(v⋅k)k
接下来看 v 1 v_1 v1的旋转
定义
w
=
k
×
v
w = k \times v
w=k×v,其中
∣
w
∣
=
∣
k
∣
∣
v
∣
s
i
n
α
=
∣
v
1
∣
|w|=|k||v|sin \alpha = |v_1|
∣w∣=∣k∣∣v∣sinα=∣v1∣
这样向量
v
1
v_1
v1绕
k
k
k旋转
θ
\theta
θ弧度后的向量
v
1
′
v_1^{'}
v1′就可以表示成
v
1
′
=
c
o
s
θ
v
1
+
s
i
n
θ
w
=
c
o
s
θ
(
v
−
(
v
⋅
k
)
k
)
+
s
i
n
θ
(
k
×
v
)
\begin{aligned} v_1^{'} &= cos\theta v_1+sin\theta w\\ &=cos\theta (v- (v\cdot k)k) + sin\theta (k \times v) \end{aligned}
v1′=cosθv1+sinθw=cosθ(v−(v⋅k)k)+sinθ(k×v)
最终的向量为
v
′
=
v
1
′
+
v
2
=
c
o
s
θ
(
v
−
(
v
⋅
k
)
k
)
+
s
i
n
θ
(
k
×
v
)
+
(
v
⋅
k
)
k
=
c
o
s
θ
v
+
(
1
−
c
o
s
θ
)
(
v
⋅
k
)
k
+
s
i
n
θ
(
k
×
v
)
\begin{aligned} v' &= v_1^{'} + v_2\\ &=cos\theta (v- (v\cdot k)k) + sin\theta (k \times v) + (v\cdot k)k\\ &=cos\theta v + (1-cos\theta)(v\cdot k)k + sin\theta (k \times v) \end{aligned}
v′=v1′+v2=cosθ(v−(v⋅k)k)+sinθ(k×v)+(v⋅k)k=cosθv+(1−cosθ)(v⋅k)k+sinθ(k×v)
令
v
=
(
v
x
v
y
v
z
)
,
k
=
(
k
x
k
y
k
z
)
v = \begin{pmatrix} v_x\\ v_y\\ v_z \end{pmatrix}, k = \begin{pmatrix} k_x\\ k_y\\ k_z \end{pmatrix}
v=
vxvyvz
,k=
kxkykz
根据差乘的定义
k
×
v
=
(
k
y
v
z
−
k
z
v
y
,
k
z
v
x
−
k
x
v
z
,
k
x
v
y
−
k
y
v
z
)
=
(
0
,
−
k
z
,
k
y
k
z
,
0
,
−
k
x
−
k
y
,
k
x
,
0
)
(
v
x
v
y
v
z
)
\begin{aligned} k\times v&= (k_y v_z -k_z v_y ,k_z v_x -k_x v_z,k_x v_y -k_y v_z)\\ &= \begin{pmatrix} &0,&-k_z,&k_y\\ &k_z,&0,&-k_x\\ &-k_y,&k_x,&0 \end{pmatrix} \begin{pmatrix} v_x\\ v_y\\ v_z \end{pmatrix} \end{aligned}
k×v=(kyvz−kzvy,kzvx−kxvz,kxvy−kyvz)=
0,kz,−ky,−kz,0,kx,ky−kx0
vxvyvz
所以
(
v
x
′
v
y
′
v
z
′
)
=
c
o
s
θ
(
v
x
v
y
v
z
)
+
s
i
n
θ
(
0
,
−
k
z
,
k
y
k
z
,
0
,
−
k
x
−
k
y
,
k
x
,
0
)
(
v
x
v
y
v
z
)
+
(
1
−
c
o
s
θ
)
(
v
x
k
x
+
v
y
k
y
+
v
z
k
z
)
(
k
x
k
y
k
z
)
\begin{aligned} \begin{pmatrix} v'_x\\ v'_y\\ v'_z\\ \end{pmatrix} &=cos\theta \begin{pmatrix} v_x\\ v_y\\ v_z\\ \end{pmatrix} + sin\theta \begin{pmatrix} &0,&-k_z,&k_y\\ &k_z,&0,&-k_x\\ &-k_y,&k_x,&0\\ \end{pmatrix} \begin{pmatrix} v_x\\ v_y\\ v_z\\ \end{pmatrix} + (1-cos\theta)(v_xk_x+v_yk_y+v_zk_z) \begin{pmatrix} k_x\\ k_y\\ k_z\\ \end{pmatrix} \end{aligned}
vx′vy′vz′
=cosθ
vxvyvz
+sinθ
0,kz,−ky,−kz,0,kx,ky−kx0
vxvyvz
+(1−cosθ)(vxkx+vyky+vzkz)
kxkykz
其中
(
1
−
c
o
s
θ
)
(
v
x
k
x
+
v
y
k
y
+
v
z
k
z
)
(
k
x
k
y
k
z
)
=
(
(
1
−
c
o
s
θ
)
(
v
x
k
x
k
x
+
v
y
k
x
k
y
+
v
z
k
x
k
z
)
(
1
−
c
o
s
θ
)
(
v
x
k
x
k
y
+
v
y
k
y
k
y
+
v
z
k
y
k
z
)
(
1
−
c
o
s
θ
)
(
v
x
k
x
k
z
+
v
y
k
y
k
z
+
v
z
k
z
k
z
)
)
=
(
a
k
x
k
x
,
a
k
x
k
y
,
a
k
x
k
z
a
k
x
k
y
,
a
k
y
k
y
,
a
k
y
k
z
a
k
x
k
z
,
a
k
y
k
z
,
a
k
z
k
z
)
(
v
x
v
y
v
z
)
,
a
=
1
−
c
o
s
θ
\begin{aligned} & (1-cos\theta)(v_xk_x+v_yk_y+v_zk_z) \begin{pmatrix} k_x\\ k_y\\ k_z\\ \end{pmatrix}\\ =& \begin{pmatrix} (1-cos\theta)(v_xk_xk_x+v_yk_xk_y+v_zk_xk_z)\\ (1-cos\theta)(v_xk_xk_y+v_yk_yk_y+v_zk_yk_z)\\ (1-cos\theta)(v_xk_xk_z+v_yk_yk_z+v_zk_zk_z)\\ \end{pmatrix}\\ =& \begin{pmatrix} ak_xk_x,&ak_xk_y,&ak_xk_z\\ ak_xk_y,&ak_yk_y,&ak_yk_z\\ ak_xk_z,&ak_yk_z,&ak_zk_z\\ \end{pmatrix} \begin{pmatrix} v_x\\ v_y\\ v_z\\ \end{pmatrix},a = 1-cos\theta \end{aligned}
==(1−cosθ)(vxkx+vyky+vzkz)
kxkykz
(1−cosθ)(vxkxkx+vykxky+vzkxkz)(1−cosθ)(vxkxky+vykyky+vzkykz)(1−cosθ)(vxkxkz+vykykz+vzkzkz)
akxkx,akxky,akxkz,akxky,akyky,akykz,akxkzakykzakzkz
vxvyvz
,a=1−cosθ
所以
(
v
x
′
v
y
′
v
z
′
)
=
(
c
o
s
θ
+
a
k
x
k
x
,
−
s
i
n
θ
k
z
+
a
k
x
k
y
,
s
i
n
θ
k
y
+
a
k
x
k
z
s
i
n
θ
k
z
+
a
k
x
k
y
,
c
o
s
θ
+
a
k
y
k
y
,
−
s
i
n
θ
k
x
+
a
k
y
k
z
−
s
i
n
θ
k
y
+
a
k
x
k
z
,
s
i
n
θ
k
x
+
a
k
y
k
z
,
c
o
s
θ
+
a
k
z
k
z
)
(
v
x
v
y
v
z
1
)
=
M
(
v
x
v
y
v
z
1
)
\begin{aligned} \begin{pmatrix} v'_x\\ v'_y\\ v'_z\\ \end{pmatrix} &= \begin{pmatrix} &cos\theta + ak_xk_x,&-sin\theta k_z+ak_xk_y,&sin\theta k_y+ak_xk_z\\ &sin\theta k_z + ak_xk_y,&cos\theta + ak_yk_y,&-sin\theta k_x+ak_yk_z \\ &-sin\theta k_y+ ak_xk_z,&sin\theta k_x+ak_yk_z ,&cos\theta+ak_zk_z \\ \end{pmatrix} \begin{pmatrix} v_x\\ v_y\\ v_z\\ 1 \end{pmatrix}= M \begin{pmatrix} v_x\\ v_y\\ v_z\\ 1 \end{pmatrix} \end{aligned}
vx′vy′vz′
=
cosθ+akxkx,sinθkz+akxky,−sinθky+akxkz,−sinθkz+akxky,cosθ+akyky,sinθkx+akykz,sinθky+akxkz−sinθkx+akykzcosθ+akzkz
vxvyvz1
=M
vxvyvz1
最终,我们得到变换矩阵为
M
=
(
c
o
s
θ
+
a
k
x
k
x
,
−
s
i
n
θ
k
z
+
a
k
x
k
y
,
s
i
n
θ
k
y
+
a
k
x
k
z
s
i
n
θ
k
z
+
a
k
x
k
y
,
c
o
s
θ
+
a
k
y
k
y
,
−
s
i
n
θ
k
x
+
a
k
y
k
z
−
s
i
n
θ
k
y
+
a
k
x
k
z
,
s
i
n
θ
k
x
+
a
k
y
k
z
,
c
o
s
θ
+
a
k
z
k
z
)
\begin{aligned} M &= \begin{pmatrix} &cos\theta + ak_xk_x,&-sin\theta k_z+ak_xk_y,&sin\theta k_y+ak_xk_z\\ &sin\theta k_z + ak_xk_y,&cos\theta + ak_yk_y,&-sin\theta k_x+ak_yk_z \\ &-sin\theta k_y+ ak_xk_z,&sin\theta k_x+ak_yk_z ,&cos\theta+ak_zk_z \\ \end{pmatrix} \end{aligned}
M=
cosθ+akxkx,sinθkz+akxky,−sinθky+akxkz,−sinθkz+akxky,cosθ+akyky,sinθkx+akykz,sinθky+akxkz−sinθkx+akykzcosθ+akzkz