二维坐标系下的向量旋转计算
本文讨论的是二维坐标系下的向量旋转,如下图所示
左图中:
x0 = |R| *cosA
y0 = |R| *sinA
向量旋转角度B得到右图:
x1 = |R| cos(A+B)
y1 = |R| sin(A+B)
展开得
x1 = x0 cosB - y0 sinB
y1 = x0 sinB + y0 cosB
所以二维空间向量旋转公式为:
\[\begin{gathered} \begin{bmatrix} x1 \\ y1 \end{bmatrix} = \begin{bmatrix} \cos{\theta} & -\sin{\theta} \\ \sin{\theta} & \cos{\theta} \\ \end{bmatrix} \begin{bmatrix} x0 \\ y0 \end{bmatrix} \end{gathered}\]