I have a question about converting functions defined in Cartesian coordinates to a cylindrical polar system. The particular coordinate transformation that I'm reading about is:
\begin{equation} \begin{pmatrix}x\\[0.3em]y\\[0.3em]z\end{pmatrix} = - \begin{pmatrix}\pi/4\\[0.3em] \pi/4\\[0.3em] \pi/4\end{pmatrix} + \begin{pmatrix} 1/\sqrt{2}\quad & 1/\sqrt{6}\quad & 1/\sqrt{3}\,\, \\[0.3em] -1/\sqrt{2}\quad & 1/\sqrt{6} \quad & 1/\sqrt{3}\,\, \\[0.3em] 0\quad & -2/\sqrt{6}\quad & 1/\sqrt{3} \,\, \end{pmatrix} \begin{pmatrix}\rho\cos\theta\\[0.3em] \rho\sin\theta \\[0.3em] \zeta \end{pmatrix}, \end{equation}
which I assume can be rewritten as
\begin{equation} \begin{pmatrix}\rho\cos\theta\\[0.3em] \rho\sin\theta \\[0.3em] \zeta \end{pmatrix} = \begin{pmatrix} 1/\sqrt{2}\quad & -1/\sqrt{2}\quad & 0\,\, \\[0.3em] 1/\sqrt{6}\quad & 1/\sqrt{6} \quad & -2/\sqrt{6}\,\, \\[0.3em] 1/\sqrt{3}\quad & 1/\sqrt{3}\quad & 1/\sqrt{3} \,\, \end{pmatrix} \begin{pmatrix}x+\pi/4\\[0.3em]y+\pi/4\\[0.3em]z+\pi/4\end{pmatrix} \end{equation}
The paper I'm reading states that $f(x,y,z) = (z,x,y)$ and so maps $(\rho,\theta,\zeta)$ to $(\rho,\theta+2\pi/3,\zeta)$ and I can see this is the case, as $f$ simply rotates around the axis $x=y=z$ (which is around the $\zeta$ axis, I think). However, I'm unsure of quite how to show this analytically.
There is another function $g(x,y,z) = (-y-\pi/2,-x-\pi/2,-z-\pi/2)$, which according to the paper, maps $(\rho,\theta,\zeta)$ to $(\rho,-\theta,-\zeta)$ but this one is far less obvious to me.
I assume this is a simple procedure to convert the function to the new coordinate system and that I'm missing the trick! Any ideas?
Function f
I'd add a $1$ as a fourth coordinate (homogenous coordinates) so that you can include the addition in your matrix multiplication. Then you'd have
$$M = \begin{pmatrix} 1/\sqrt2 & 1/\sqrt6 & 1/\sqrt3 & -\pi/4 \\ -1/\sqrt2 & 1/\sqrt6 & 1/\sqrt3 & -\pi/4 \\ 0 & -2/\sqrt6 & 1/\sqrt3 & -\pi/4 \\ 0 & 0 & 0 & 1 \end{pmatrix} \qquad M^{-1}=\begin{pmatrix} 1/\sqrt2 & -1/\sqrt2 & 0 & 0 \\ 1/\sqrt6 & 1/\sqrt6 & -2/\sqrt6 & 0 \\ 1/\sqrt3 & 1/\sqrt3 & 1/\sqrt3 & \pi\sqrt3/4 \\ 0 & 0 & 0 & 1 \end{pmatrix} $$
Now you can express $f$ like this:
$$ \begin{pmatrix} \rho'\cos\theta' \\ \rho'\sin\theta' \\ \zeta' \\ 1 \end{pmatrix} = M^{-1}\begin{pmatrix} 0 & 0 & 1 & 0 \\ 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix}M \begin{pmatrix} \rho\cos\theta \\ \rho\sin\theta \\ \zeta \\ 1 \end{pmatrix} = \begin{pmatrix} -1/2 & -\sqrt3/2 & 0 & 0 \\ \sqrt3/2 & -1/2 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} \rho\cos\theta \\ \rho\sin\theta \\ \zeta \\ 1 \end{pmatrix} $$
So the identity $\zeta'=\zeta$ is very obvious. In the top left $2\times2$ part of the combined matrix you see this rotation you are talking about. You see that the matrix is orthogonal, so it will preserve lenths, therefore $\rho' = \rho$. You can also compute the angle of rotation $\varphi$ using
\begin{gather*} \cos\varphi = -\frac12 \qquad \sin\varphi = \frac{\sqrt3}2 \\ \varphi = \arctan\frac{\frac{\sqrt3}2}{-\frac12}+\pi = \arctan(-\sqrt3)+\pi = -\frac13\pi+\pi = \frac23\pi \end{gather*}
As usual when computing an angle from values for $\sin$ and $\cos$, you have to take care of the fact that $\arctan$ is only defined up to multiples of $\pi$. In computer programs there is often a function
atan2to take care of this fact.Function g
Now the same for $g$:
$$ \begin{pmatrix} \rho''\cos\theta'' \\ \rho''\sin\theta'' \\ \zeta'' \\ 1 \end{pmatrix} = M^{-1}\begin{pmatrix} 0 & -1 & 0 & -\pi/2 \\ -1 & 0 & 0 & -\pi/2 \\ 0 & 0 & -1 & -\pi/2 \\ 0 & 0 & 0 & 1 \end{pmatrix}M \begin{pmatrix} \rho\cos\theta \\ \rho\sin\theta \\ \zeta \\ 1 \end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & -1 & 0 & 0 \\ 0 & 0 & -1 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} \rho\cos\theta \\ \rho\sin\theta \\ \zeta \\ 1 \end{pmatrix} $$
The sign change $\zeta''=-\zeta$ is easy to see. You can also see that the length $\rho''=\rho$ is preserved, but the angle $\theta''=-\theta$ changes its sign. If you want to do this formally as well, you'd again spot the orthogonal matrix, and identify it as a reflection not a rotation.