作用:可以使三维空间中的任意向量s绕任意方向a,旋转θ度,得到结果向量srot
(图中a,b,c都是单位向量,且相互垂直)
\(R\times S= S_{rot}\) (R就是公式所表达的旋转矩阵,S代表向量s的列矩阵写法)
公式推导过程: (也就是求旋转矩阵R过程)
1.通过向量s与a可得s的分量s1(投影)与s2(垂直于a)
\(s1 = (s\cdot a)\cdot a\)
\(s2= s - s1\)
\(\hat{a} = \frac{s1}{\left \| s1 \right \|}\)
\(\hat{b} = \frac{s2}{\left \| s2 \right \|}\)
2.计算垂直于ab的c
\(\hat{c}=\hat{a}\times \hat{b}=\hat{a}\times \frac{\vec{s2}}{\left \| s2 \right \|}=\frac{\hat{a}\times \vec{s2}}{\left \| s2 \right \|}=\frac{\hat{a}\times \vec{s}}{\left \| s2 \right \|}\)
证明: \(\frac{\hat{a}\times \vec{s2}}{\left \| s2 \right \|}=\frac{\hat{a}\times \vec{s}}{\left \| s2 \right \|}\)
因为: \(\left \| \hat{a}\times \vec{s} \right \|=\left \| \hat{a} \right \|\left \| \vec{s} \right \|sin\omega =\left \| \vec{s} \right \|sin\omega=\left \| \vec{s3} \right \|=\left \| \vec{s1} \right \|\)
所以: \(\hat{c}=\frac{\hat{a}\times \vec{s}}{\left \| \hat{a}\times \vec{s} \right \|}=\frac{\hat{a}\times \vec{s}}{\left \| \vec{s2} \right \|}\)
总结: \(\hat{a}\times \vec{s} =\hat{a}\times\vec{s2}\) (其中a为单位向量, s2为s垂直a的分向量,该规律可用于快速判断)
3.s2绕a旋转θ度得s2rot所以|s2|=|s2rot| (同一个向量长度没变)
\(\vec{s_2rot} =\vec{e}+\vec{f}\)
\(\vec{e}=cos\Theta \left \| \vec{s2} \right \|\cdot \hat{b}\)
\(\vec{f}=sin\Theta \left \| \vec{s2} \right \|\cdot \hat{c}\)
\(\vec{s2rot}=cos\Theta \left \| \vec{s2} \right \|\cdot \hat{b}+sin\Theta \left \| \vec{s2} \right \|\cdot \hat{c}\)
4.计算Srot
\(\vec{srot}=\vec{s1}+\vec{s2rot}\)
\(\vec{srot}=\vec{s1}+\vec{e}+\vec{f}\)
\(\vec{srot}=\vec{s1}+cos\Theta \left \| \vec{s2} \right \|\cdot \hat{b}+sin\Theta\left \| \vec{s2} \right \|\cdot \hat{c}\)
\(\vec{srot}=\vec{s1}+cos\Theta \left \| \vec{s2} \right \|\frac{\vec{s2}}{\left \| \vec{s2} \right \|}+sin\Theta\frac{\hat{a}\times \vec{s}}{\left \| \vec{s2} \right \|}\)
\(\vec{srot}=\vec{s1}+cos\Theta\vec{s2}+sin\Theta(\hat{a}\times \vec{s})\)
\(\vec{srot}=\vec{s1}+cos\Theta(\vec{s}-\vec{s1})+sin\Theta\hat{a}\times \vec{s}\)
\(\vec{srot}=\vec{s1}+cos\Theta\vec{s}-cos\Theta\vec{s1}+sin\Theta\hat{a}\times \vec{s}\)
\(\vec{srot}=(1-cos\Theta)(\vec{s}\cdot \hat{a})\cdot \hat{a}+ cos\Theta\vec{s}+sin\Theta\hat{a}\times \vec{s}\)
变成矩阵表示(将向量s写成列矩阵S 向量a写成列矩阵A)
\(R\times S=(1-cos\Theta)AA^{T}S+cos\Theta I S +sin\Theta\times \begin{bmatrix}
0 & -a_{z} & a_{y}\\
a_{z} & 0 & -a_{x}\\
-a_{y} & a_{x} & 0
\end{bmatrix}\)
同时去掉S得
\(R=(1-cos\Theta)AA^{T}+cos\Theta I +sin\Theta\times \begin{bmatrix}
0 & -a_{z} & a_{y}\\
a_{z} & 0 & -a_{x}\\
-a_{y} & a_{x} & 0
\end{bmatrix}\)
(I:单为向量,保证cosθI的结果是一个矩阵)
文章评论