回転行列の表式

 単位ベクトル\(V=(x,y,z)\)の周りに角度\(\theta\)回転させる行列\(R=R(x,y,z,\theta)\)は
$$R=
\begin{pmatrix}
x^2(1-\cos\theta) + \cos\theta &
x y(1-\cos\theta) – z \sin\theta &
z x (1-\cos\theta) + y \sin\theta\\
x y (1-\cos\theta) + z \sin\theta&
y^2 (1-\cos\theta) + \cos\theta&
y z (1-\cos\theta) – x \sin\theta\\
z x (1-\cos\theta) – y \sin\theta&
y z (1-\cos\theta) + x \sin\theta&
z^2 (1-\cos\theta) + \cos\theta
\end{pmatrix}
$$と表現することができます。

 上記の行列の対格成分の和は \(S = 1 + 2\cos\theta\) となります。この性質に注目すると、長さを変えない二つの回転行列 \(M_1,M_2\) があったとき、その間の角度を求めることができます。すなわち、
$$R M_1 = M_2 \Leftrightarrow R = M_2 M_1^{-1}
$$となるので、\(M_2 M_1^{-1}\) の対格成分の和を \(S\) としたとき、ふたつの回転行列 \(M_1,M_2\) の間の角度 \(\theta\) は
$$\theta = \arccos \frac{S-1}{2}
$$ということになります。

球面上に一様に分布する乱数ベクトル

 0から1までの一様な乱数 \(\alpha,\beta\) を使った、半径1の球面上に等確率で存在するベクトル \(V\) は
$$V=\begin{pmatrix}
2 \beta -1 \\
2 \sin (2\pi\alpha) \sqrt{\beta(1-\beta)} \\
2 \cos (2\pi\alpha) \sqrt{\beta(1-\beta)}
\end{pmatrix}$$と表現することができます。

乱数的回転行列

 0から1までの一様な乱数 \(\alpha,\beta,\gamma\) を使って、ランダムな回転行列 \(M\) は次のように表すことができます。
$$M=\begin{pmatrix}
\cos(2\pi\alpha) & \sin(2\pi\alpha) & 0\\
-\sin(2\pi\alpha) & \cos(2\pi\alpha)& 0\\
0&0&1
\end{pmatrix}
\begin{pmatrix}
1&0&0\\
0&\beta&\sqrt{\beta(1-\beta)}\\
0&-\sqrt{\beta(1-\beta)}&\beta
\end{pmatrix}
\begin{pmatrix}
\cos(2\pi\gamma)&\sin(2\pi\gamma)&0\\
-\sin(2\pi\gamma)&\cos(2\pi\gamma)&0\\
0&0&1
\end{pmatrix}$$

contents