方位行列の偏微分

以前に書いた方位行列の偏微分を求めておこう。

\begin{pmatrix}x \\ y \\ z \end{pmatrix} = \begin{pmatrix}\mathbf{a} & \mathbf{b} & \mathbf{c} \end{pmatrix}\begin{pmatrix}h \\ k \\ l \end{pmatrix} = \begin{pmatrix}a_x & b_x & c_x\\ a_y & b_y & c_y\\ a_z & b_z & c_z \end{pmatrix}\begin{pmatrix}h \\ k \\ l \end{pmatrix}
となるような方位行列\mathbf Aを計算すると、
\begin{pmatrix}x \\ y \\ z \end{pmatrix} = \begin{pmatrix}a & b\cos\gamma & c\cos\beta\\ 0 & b\sin\gamma & \frac{c}{\sin\gamma}(\cos\alpha - \cos\beta \cos\gamma)\\ 0 & 0 & \frac{c}{\sin\gamma}\sqrt{1 - \cos^2\alpha - \cos^2\beta - \cos^2\gamma  + 2\cos\alpha\cos\beta\cos\gamma} \end{pmatrix}\begin{pmatrix}h \\ k \\ l \end{pmatrix}
となるのだった。これを偏微分していく。ただし、 c_z = \sqrt{c^2 - c_x^2 - c_y^2} の形も使う。

\frac{\partial \mathbf A}{\partial a} = \begin{pmatrix}1 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix}

\frac{\partial \mathbf A}{\partial b} = \begin{pmatrix}0 & \cos\gamma & 0 \\ 0 & \sin\gamma & 0 \\ 0 & 0 & 0 \end{pmatrix}

\frac{\partial \mathbf A}{\partial c} = \begin{pmatrix}0 & 0 & \cos\beta\\ 0 & 0 & \frac{1}{\sin\gamma}(\cos\alpha - \cos\beta \cos\gamma)\\ 0 & 0 & \frac{1}{\sin\gamma}\sqrt{1 - \cos^2\alpha - \cos^2\beta - \cos^2\gamma  + 2\cos\alpha\cos\beta\cos\gamma} \end{pmatrix}

ここまでは楽勝。

\frac{\partial \mathbf A}{\partial \alpha} =\begin{pmatrix}0 & 0 & 0 \\ 0 & 0 & \frac{-c \sin\alpha}{\sin\gamma}\\ 0 & 0 & \frac{\partial c_z}{\partial \alpha} \end{pmatrix}

\frac{\partial \mathbf A}{\partial \beta} = \begin{pmatrix}0 & 0 & -c\sin\beta\\ 0 & 0 & \frac{c \sin\beta \cos\gamma}{\sin\gamma}\\ 0 & 0 & \frac{\partial c_z}{\partial \beta} \end{pmatrix}

以下、検算してない(上も保証はできないけれど)

\frac{\partial \mathbf A}{\partial \gamma} = \begin{pmatrix}0 & -b\sin\gamma & 0 \\ 0 & b\cos\gamma & \frac{c (-\cos\alpha \cos\gamma + \cos\beta)}{\sin^2\gamma} \\ 0 & 0 & \frac{\partial c_z}{\partial \gamma} \end{pmatrix}

ここもなんとか。問題は  c_z偏微分であるが、 c_z = \sqrt{c^2 - c_x^2 - c_y^2} を利用して、

 \frac{\partial c_z}{\partial \beta} = \frac{-2 c_x \frac{\partial c_x}{\partial \beta} - 2 c_y\frac{\partial c_y}{\partial \beta} }{2 c_z}
 \frac{\partial c_z}{\partial \gamma} = \frac{-2 c_x \frac{\partial c_x}{\partial \gamma} - 2 c_y\frac{\partial c_y}{\partial \gamma} }{2 c_z}
のように、上で計算した数値を使って計算できる。