Transform
Translate
$ \bf T = \begin{bmatrix} 1 & 0 & 0 & t_x \\ 0 & 1 & 0 & t_y \\ 0 & 0 & 1 & t_z \\ 0 & 0 & 0 & 1 \end{bmatrix}
Rotation
いろいろあるので省略
$ \bf R
Scale
$ \bf S = \begin{bmatrix} s_x & 0 & 0 & 0 \\ 0 & s_y & 0 & 0 \\ 0 & 0 & s_z & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}
TRS
$ \bf M = \bf T \bf R \bf S
Compose
上のを掛け算しただけ
$ \bf M = \begin{bmatrix} {\bf R}_{11} s_x & {\bf R}_{12} s_y & {\bf R}_{13} s_z & t_x \\ {\bf R}_{21} s_x & {\bf R}_{22} s_y & {\bf R}_{23} s_z & t_y \\ {\bf R}_{31} s_x & {\bf R}_{32} s_y & {\bf R}_{33} s_z & t_z \\ 0 & 0 & 0 & 1 \end{bmatrix}
Decompose
上のComposeを見たら自明
$ s = \begin{pmatrix} \| ({\bf M}_{11}, {\bf M}_{21}, {\bf M}_{31}) \| \\ \| ({\bf M}_{12}, {\bf M}_{22}, {\bf M}_{32}) \| \\ \| ({\bf M}_{13}, {\bf M}_{23}, {\bf M}_{33}) \| \end{pmatrix}
$ {\bf R} = \begin{bmatrix} \displaystyle \frac{{\bf M}_{11}}{s_x} & \displaystyle \frac{{\bf M}_{12}}{s_y} & \displaystyle \frac{{\bf M}_{13}}{s_z} \\ & \\ \displaystyle \frac{{\bf M}_{21}}{s_x} & \displaystyle \frac{{\bf M}_{22}}{s_y} & \displaystyle \frac{{\bf M}_{23}}{s_z} \\ & \\ \displaystyle \frac{{\bf M}_{31}}{s_x} & \displaystyle \frac{{\bf M}_{32}}{s_y} & \displaystyle \frac{{\bf M}_{33}}{s_z} \end{bmatrix}
$ t = \begin{pmatrix} {\bf M}_{14} \\ {\bf M}_{24} \\ {\bf M}_{34} \end{pmatrix}
こちらもThree.js語か?