Last updated 2 years ago
Was this helpful?
線代 ⟩ 矩陣 ⟩ 旋轉矩陣 ⟩ 繞軸旋轉
若以單位向量 u=[u1 u2 u3]T\mathbf{u} = [u_1 \ u_2 \ u_3]^Tu=[u1 u2 u3]T 為軸,將 P\mathbf{P}P 點旋轉 θ\thetaθ 角,得到 P′\mathbf{P'}P′ 點,則: (1) P′=(cosθ) P + (1−cosθ) (P⋅u)u+ (sinθ) (u×P)(1) \ \ \mathbf{P'} = ({\color{orange} \cos\theta}) \ \mathbf{P} \ + \ ({\color{orange}1-\cos\theta}) \ (\mathbf{P\cdot u}) \mathbf{u} + \ ({\color{orange}\sin\theta}) \ (\mathbf{u\times P}) (1) P′=(cosθ) P + (1−cosθ) (P⋅u)u+ (sinθ) (u×P) (2) P′=[ (cosθ) I + (1−cosθ) uuT+ (sinθ) M ] P(2) \ \ \mathbf{P'} = [ \ ({\color{orange}\cos\theta}) \ \mathbf{I} \ + \ ({\color{orange}1-\cos\theta}) \ \mathbf{u} \mathbf{u}^T + \ ({\color{orange}\sin\theta}) \ \mathbf{M} \ ] \ \mathbf{P}(2) P′=[ (cosθ) I + (1−cosθ) uuT+ (sinθ) M ] P
其中: I=[100010001]\mathbf{I} = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}I=100010001 (單位矩陣) uuT=[u12u1u2u1u3u2u1u22u2u3u3u1u3u2u32]\mathbf{uu^T} = \begin{bmatrix} u_{1}^2 & u_{1} u_2 & u_{1} u_3 \\ u_{2} u_1 & u_{2}^2 & u_{2} u_3 \\ u_{3} u_1 & u_{3} u_2 & u_{3}^2 \end{bmatrix}uuT=u12u2u1u3u1u1u2u22u3u2u1u3u2u3u32 ( 注意:① 行向量都平行 u\mathbf{u}u ② MT=M\mathbf{M^T} = \mathbf{M}MT=M ) M=[0−u3u2u30−u1−u2u10]\mathbf{M} = \begin{bmatrix} 0 & -u_3 & u_2 \\ u_3 & 0 & -u_1 \\ -u_2 & u_1 & 0 \end{bmatrix}M=0u3−u2−u30u1u2−u10 ( 注意:① 行向量都垂直 u\mathbf{u}u ② MT=−M\mathbf{M^T} = -\mathbf{M}MT=−M )
向量垂直分解
內積 ⟩ 內積的矩陣表示法
外積 ⟩ 外積的矩陣表示法
垂直向量
四元數旋轉
旋轉是一種線性變換。
「四元數旋轉」就是一種繞軸旋轉。
Mathematics for 3D Game ⟩ 3.3 Rotation Transforms ⟩ Rotations about an Axis