基础知识

旋转矩阵

#线代 #矩阵 #旋转矩阵 别名:旋转矩阵

二维推导中的旋转矩阵

令 G 为 x-y 平面上的向量,长度为 rr,它相对于 x 轴画出角度 ν\nu。现在我们将 G 逆时针旋转角度 θ\theta。如果 (x,y)(x,y) 是向量 G 尖端的原始坐标,则 (x′,y′)(x',y') 将是旋转后的新坐标。

Derivation of 2D Rotation Matrix

用极坐标形式表达 (x,y)(x, y):

x=rcos⁡ν— (1)y=rsin⁡ν— (2) \begin{aligned} x &= r \cos \nu \quad \text{--- (1)} \\ y &= r \sin \nu \quad \text{--- (2)} \end{aligned}

同理,用极坐标形式表达 (x′,y′)(x', y'):

x′=rcos⁡(ν+θ)y′=rsin⁡(ν+θ) \begin{aligned} x' &= r \cos(\nu + \theta) \\ y' &= r \sin(\nu + \theta) \end{aligned}


x′=r(cos⁡νcos⁡θ−sin⁡νsin⁡θ)=rcos⁡νcos⁡θ−rsin⁡νsin⁡θ x' = r(\cos \nu \cos \theta - \sin \nu \sin \theta) = r\cos \nu \cos \theta - r\sin \nu \sin \theta

从 (1) 和 (2) 我们得到:

x′=xcos⁡θ−ysin⁡θ— (3) x' = x \cos \theta - y \sin \theta \quad \text{--- (3)}

y′=r(sin⁡νcos⁡θ+cos⁡νsin⁡θ)=rsin⁡νcos⁡θ+rcos⁡νsin⁡θ y' = r(\sin \nu \cos \theta + \cos \nu \sin \theta) = r\sin \nu \cos \theta + r\cos \nu \sin \theta
y′=ycos⁡θ+xsin⁡θ— (4) y' = y \cos \theta + x \sin \theta \quad \text{--- (4)}

如果我们借助 2×22 \times 2 旋转矩阵来表示 (3) 和 (4),我们会得到:

[x′y′]=[cos⁡θ−sin⁡θsin⁡θcos⁡θ][xy] \begin{bmatrix} x' \\ y' \end{bmatrix} = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix}

所以

[cos⁡θ−sin⁡θsin⁡θcos⁡θ] \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix}

将是旋转矩阵。