ロドリゲスの回転公式(3次元の回転行列)

三次元空間での回転に関するロドリゲスの回転公式を紹介します。

まずはベクトル版を紹介し,後半では行列版(三次元空間における回転行列)を紹介します。

三次元空間における回転(ベクトル)

ロドリゲスの回転公式(ベクトル)

pic01 三次元空間において,n→\overrightarrow{n} を軸として,r→\overrightarrow{r} を θ\theta 回転させた点 r′→\overrightarrow{r'} は,

r′→=(cos⁡θ)r→+(1−cos⁡θ)(r→⋅n→)n→+(sin⁡θ)(n→×r→)\overrightarrow{r'}=(\cos\theta)\overrightarrow{r}+(1-\cos\theta)(\overrightarrow{r}\cdot\overrightarrow{n})\overrightarrow{n}+(\sin\theta)(\overrightarrow{n}\times\overrightarrow{r})

  • n→\overrightarrow{n} は軸を表す単位ベクトルです。回転の向きは,右ねじの進む向きが n→\overrightarrow{n} と一致するような向きを正とします。
  • r→\overrightarrow{r} は回転前の点を表す位置ベクトルです。r′→\overrightarrow{r'} は回転後の点を表す位置ベクトルです。
  • n→×r→\overrightarrow{n}\times\overrightarrow{r} は外積です。n→\overrightarrow{n} にも r→\overrightarrow{r} にも垂直なベクトルです。→ベクトルの内積と外積の意味と嬉しさ
  • r′→\overrightarrow{r'} を,r→\overrightarrow{r} と n→\overrightarrow{n} と n→×r→\overrightarrow{n}\times\overrightarrow{r} の線形結合で表しています。
例題1

点 r→=(2,1,0)\overrightarrow{r}=(2,1,0) を軸 n→=(1,0,0)\overrightarrow{n}=(1,0,0) のまわりに θ=180∘\theta=180^{\circ} 回転させた点の座標を計算せよ。

pic02

解答

ロドリゲスの回転公式を使ってみる。cos⁡180∘=−1\cos 180^{\circ}=-1,sin⁡180∘=0\sin 180^{\circ}=0 より

r′→=−(2,1,0)+2×2(1,0,0)=(2,−1,0)\overrightarrow{r'}=-(2,1,0)+2\times 2(1,0,0)=(2,-1,0)

なお,例題1はロドリゲスの回転公式を使わなくても実際に 180∘180^{\circ} 回転させてみれば答えに納得できます。

ロドリゲスの回転公式の証明

r′→\overrightarrow{r'} を,r→\overrightarrow{r} と n→\overrightarrow{n} と n→×r→\overrightarrow{n}\times\overrightarrow{r} の線形結合で表します。

証明

pic03 図のように A,X,Y,ZA,X,Y,Z を定める。(YY は XX を 90∘90^{\circ} 回転させた点。xx 軸が AXAX で yy 軸が AYAY である xyxy 座標平面をイメージするとよい)

AZ→=AX→cos⁡θ+AY→sin⁡θ\overrightarrow{AZ}=\overrightarrow{AX}\cos\theta+\overrightarrow{AY}\sin\theta

より,

r′→=OA→+AZ→=OA→+AX→cos⁡θ+AY→sin⁡θ\overrightarrow{r'}=\overrightarrow{OA}+\overrightarrow{AZ}\\ =\overrightarrow{OA}+\overrightarrow{AX}\cos\theta+\overrightarrow{AY}\sin\theta

これに,以下を代入するとロドリゲスの回転公式になる。

  • 正射影ベクトルの考え方より,OA→=(r→⋅n→)n→\overrightarrow{OA}=(\overrightarrow{r}\cdot\overrightarrow{n})\overrightarrow{n}
  • AX→=r→−OA→=r→−(r→⋅n→)n→\overrightarrow{AX}=\overrightarrow{r}-\overrightarrow{OA}=\overrightarrow{r}-(\overrightarrow{r}\cdot\overrightarrow{n})\overrightarrow{n}
  • AY→\overrightarrow{AY} は,n→\overrightarrow{n} と r→\overrightarrow{r} に垂直で長さが ∣AX→∣=∣r→∣sin⁡∠AOX|\overrightarrow{AX}|=|\overrightarrow{r}|\sin\angle AOX なので,外積の定義より AY→=n→×r→\overrightarrow{AY}=\overrightarrow{n}\times\overrightarrow{r}

三次元空間における回転行列

ロドリゲスの回転公式(行列)

三次元空間における回転行列は,

Rθ=(1−cos⁡θ)(nx2nxnynxnznxnyny2nynznxnznynznz2)    +(cos⁡θ−nzsin⁡θnysin⁡θnzsin⁡θcos⁡θ−nxsin⁡θ−nysin⁡θnxsin⁡θcos⁡θ)R_{\theta}=(1-\cos\theta)\begin{pmatrix}n_x^2&n_xn_y&n_xn_z\\n_xn_y&n_y^2&n_yn_z\\n_xn_z&n_yn_z&n_z^2\end{pmatrix}\\ \:\:\:\:+\begin{pmatrix}\cos\theta&-n_z\sin\theta&n_y\sin\theta\\n_z\sin\theta&\cos\theta&-n_x\sin\theta\\-n_y\sin\theta&n_x\sin\theta&\cos\theta\end{pmatrix}

つまり,三次元空間において,n→=(nx,ny,nz)\overrightarrow{n}=(n_x,n_y,n_z) を軸として,r→=(x,y,z)\overrightarrow{r}=(x,y,z) を θ\theta 回転させた点の座標は Rθr→⊤R_{\theta}\overrightarrow{r}^{\top}

例題1(再掲)

点 r→=(2,1,0)\overrightarrow{r}=(2,1,0) を軸 n→=(1,0,0)\overrightarrow{n}=(1,0,0) のまわりに θ=180∘\theta=180^{\circ} 回転させた点の座標を計算せよ。

解答

今度は回転行列を使って計算してみる。cos⁡180∘=−1\cos 180^{\circ}=-1,sin⁡180∘=0\sin 180^{\circ}=0,ny=nz=0n_y=n_z=0 より

Rθ=2(100000000)+(−1000−1000−1)=(1000−1000−1)R_{\theta}=2\begin{pmatrix}1&0&0\\0&0&0\\0&0&0\end{pmatrix}+\begin{pmatrix}-1&0&0\\0&-1&0\\0&0&-1\end{pmatrix}\\ =\begin{pmatrix}1&0&0\\0&-1&0\\0&0&-1\end{pmatrix}

よって,回転後の座標は Rθ(210)=(2−10)R_{\theta}\begin{pmatrix}2\\1\\0\end{pmatrix}=\begin{pmatrix}2\\-1\\0\end{pmatrix}

二次元の回転行列との関係

  • 二次元の回転行列 (cos⁡θ−sin⁡θsin⁡θcos⁡θ)\begin{pmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{pmatrix} はよく使いますね。→一次変換の意味と重要な5つの例(折り返し・回転・対称移動)

  • ロドリゲスの回転公式において,n→\overrightarrow{n} の向きがいずれかの座標軸の向きと一致する場合,二次元の回転行列が出てきます。例えば n→=(0,0,1)\overrightarrow{n}=(0,0,1) とすると,Rθ=(cos⁡θ−sin⁡θ0sin⁡θcos⁡θ0001)R_{\theta}=\begin{pmatrix}\cos\theta&-\sin\theta&0\\\sin\theta&\cos\theta&0\\0&0&1\end{pmatrix} となります。

行列版の導出

ロドリゲスの回転公式(行列)は,ベクトル版から簡単に導出できます。

証明

ベクトル版の公式:

(cos⁡θ)r→+(1−cos⁡θ)(r→⋅n→)n→+(sin⁡θ)(n→×r→)(\cos\theta)\overrightarrow{r}+(1-\cos\theta)(\overrightarrow{r}\cdot\overrightarrow{n})\overrightarrow{n}+(\sin\theta)(\overrightarrow{n}\times\overrightarrow{r})

に各成分を代入すると,

  • 第一項は (cos⁡θ000cos⁡θ000cos⁡θ)(xyz)\begin{pmatrix}\cos\theta&0&0\\0&\cos\theta&0\\0&0&\cos\theta\end{pmatrix}\begin{pmatrix}x\\y\\z\end{pmatrix}

  • 第二項は (1−cos⁡θ)(nx2nxnynxnznxnyny2nynznxnznynznz2)(xyz)(1-\cos\theta)\begin{pmatrix}n_x^2&n_xn_y&n_xn_z\\n_xn_y&n_y^2&n_yn_z\\n_xn_z&n_yn_z&n_z^2\end{pmatrix}\begin{pmatrix}x\\y\\z\end{pmatrix}

  • 第三項は (0−nzsin⁡θnysin⁡θnzsin⁡θ0−nxsin⁡θ−nysin⁡θnxsin⁡θ0)(xyz)\begin{pmatrix}0&-n_z\sin\theta&n_y\sin\theta\\n_z\sin\theta&0&-n_x\sin\theta\\-n_y\sin\theta&n_x\sin\theta&0\end{pmatrix}\begin{pmatrix}x\\y\\z\end{pmatrix}

となり,足し合わせると Rθ(xyz)R_{\theta}\begin{pmatrix}x\\y\\z\end{pmatrix} となる。

ロドリゲスの回転公式を最初見たときは「なんかごちゃごちゃしているなあ」と感じましたが,何度も眺めていると「けっこうきれいだなあ」という気持ちになりました。