Let $ (\hat i, \hat j, \hat k) $ be unit vectors in Cartesian coordinate and $ (\hat e_\rho, \hat e_\theta, \hat e_z)$ be on spherical coordinate.
Using the relation, $$ \hat e_\rho = \frac{\frac{\partial \vec r}{\partial \rho}}{ \left | \frac{\partial \vec r}{\partial \rho} \right |}, \hat e_\theta = \frac{\frac{\partial \vec r}{\partial \theta}}{ \left | \frac{\partial \vec r}{\partial \theta} \right |}, \;\; \hat e_z = \frac{\frac{\partial \vec r}{\partial z}}{ \left | \frac{\partial \vec r}{\partial z} \right |} $$
We have the relation $$\begin{bmatrix} \hat e_{\rho}\\ \hat e_{\theta}\\ \hat e_{z} \end{bmatrix} = \begin{bmatrix} \cos \phi & \sin \phi & 0\\ -\sin \phi & \cos \phi & 0\\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} \hat i\\ \hat j\\ \hat k \end{bmatrix}$$
$$\text { Let } A = \begin{bmatrix} \cos \phi & \sin \phi & 0\\ -\sin \phi & \cos \phi & 0\\ 0 & 0 & 1 \end{bmatrix}$$
To express unit vectors of Cartesian coordinate in Spherical coordinates, the author uses,
$$\hat i = \frac { \begin{vmatrix} \hat e_{\rho} & \sin \phi & 0\\ \hat e_{\theta} & \cos \phi & 0\\ 0 & 0 & 1 \end{vmatrix} }{|A|} \\ \hat j = \frac { \begin{vmatrix} \cos \phi & \hat e_{\rho} & 0\\ -\sin \phi & \hat e_{\theta} & 0\\ 0 & 0 & 1 \end{vmatrix} }{|A|} \\\hat k = \frac { \begin{vmatrix} \cos \phi & \sin \phi & 0\\ -\sin \phi & \cos \phi & 0\\ 0 & 0 & \hat e_z \end{vmatrix} }{|A|}
$$
Which I cannot understand! Can anyone help me to understand it?
$$ \begin{bmatrix} \hat i\\ \hat j\\ \hat k \end{bmatrix} = \begin{bmatrix} \cos \phi & \sin \phi & 0\\ -\sin \phi & \cos \phi & 0\\ 0 & 0 & 1 \end{bmatrix}^{-1} \begin{bmatrix} \hat e_{\rho}\\ \hat e_{\theta}\\ \hat e_{z} \end{bmatrix} $$
Looks intuitive but certainly the previous way is faster. I would like to know above relation works if it works.
Thank you!!