ロドリゲスの回転公式
公式
射影される位置ベクトルを$ \bm r・回転軸となる単位ベクトルを$ \bm u・回転する角度$ \thetaとしたとき、 $ \bm r' = \bm r \cos \theta + (\bm u \times \bm r) \sin \theta + \bm u (\bm u \cdot \bm r) (1 - \cos \theta)
行列
いわゆる Matrix3.fromAxisAngle
回転軸となる単位ベクトル$ \bm u・回転する角度$ \thetaを用いて、 $ \bf R = \begin{bmatrix} u_x^2 (1 - \cos \theta) + \cos \theta & u_x u_y (1 - \cos \theta) - u_z \sin \theta & u_x u_z (1 - \cos \theta) + u_y \sin \theta \\ u_x u_y (1 - \cos \theta) + u_z \sin \theta & u_y^2 (1 - \cos \theta) + \cos \theta & u_y u_z (1 - \cos \theta) - u_x \sin \theta \\ u_x u_z (1 - \cos \theta) - u_y \sin \theta & u_y u_z (1 - \cos \theta) + u_x \sin \theta & u_z^2 (1 - \cos \theta) + \cos \theta \end{bmatrix}
分解
$ \bf U = \begin{bmatrix} 0 & -u_z & u_y \\ u_z & 0 & -u_x \\ -u_y & u_x & 0 \end{bmatrix}とおき、
$ \bf R = \bf I + \sin \theta \ \bf U + (1 - \cos \theta) \ \bf U^2