I have a set of equations that describe a wire in (100) direction.
I want to rotate the wire such that it's in the direction (111).
My initial plan (which failed) was to use Euler coordinates and first apply a rotation $R_y(\pi/4)$ and then $R_z(\pi/4)$
where the rotation matrices are defined as follows:
$$\begin{alignat}{1} R_x(\theta) &= \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos \theta & -\sin \theta \\[3pt] 0 & \sin \theta & \cos \theta \\[3pt] \end{bmatrix} \\[6pt] R_y(\theta) &= \begin{bmatrix} \cos \theta & 0 & \sin \theta \\[3pt] 0 & 1 & 0 \\[3pt] -\sin \theta & 0 & \cos \theta \\ \end{bmatrix} \\[6pt] R_z(\theta) &= \begin{bmatrix} \cos \theta & -\sin \theta & 0 \\[3pt] \sin \theta & \cos \theta & 0\\[3pt] 0 & 0 & 1\\ \end{bmatrix} \end{alignat}$$
If I now peform the operation $R_z(\pi/4) R_y(\pi/4) [x, y, z]^T=\left[\begin{matrix}0.5 x - 0.5 y + 0.5\sqrt{2} z\\0.5\sqrt{2} x + 0.5\sqrt{2} y\\- 0.5 x + 0.5 y + 0.5\sqrt{2} z\end{matrix}\right]$
and fill in $[x,y,z]=[1,0,0]$ I get $\left[\begin{matrix}0.5 \\0.5\sqrt{2} \\- 0.5 \end{matrix}\right]$, while I want $\left[\begin{matrix}1/\sqrt{3} \\1/\sqrt{3} \\1/\sqrt{3} \end{matrix}\right]$.
What in my reasoning is incorrect, and how can I solve it?
I suggest a solution which consists in defining the rotation as an orthogonal transformation that preserves orientation in $\mathbb{R}^3$. We denote by $e_1=(1,0,0)^T, e_2=(0,1, 0)^T, e_3=(0,0,1)^T$ the standard basis in $\mathbb{R}^3$. Now we construct a new orthonormal basis $(u_1, u_2, u_3)$, where $u_1=\dfrac{1}{\sqrt{3}}(1,1,1)^T$ is the unit vector associated to $v=(1,1,1)^T$. The orthogonal complement of $v$ is defined as $v^\perp=\{w=(x,y,z)^T\:|\: w\perp v \Leftrightarrow v^Tw=0 \Leftrightarrow x+y+z=0\}$. The subspace $v^\perp$ is 2-dimensional. We choose a vector $w=(-1,1,0)^T$ in this subspace and denote by $u_2=\dfrac{1}{\sqrt{2}}(-1,1,0)^T$ its unit vector. The cross product $u_1\times u_2:=u_3=\dfrac{1}{\sqrt{6}}(-1,-1, 2)^T$ is a unit vector in $v^\perp$, and by construction the orthonormal basis $(u_1, u_2, u_3)$ is positively oriented. Thus the linear map $R:\mathbb{R}^3\to\mathbb{R}^3$ such that $R(e_k)=u_k$, $k=1,2,3$, is the required rotation. Its matrix with respect to the standard basis is the matrix $A$ having as columns the vectors $R(e_1), R(e_2), R(e_3)$: $$A=\left[\begin{array}{rrr}\dfrac{1}{\sqrt{3}}&-\dfrac{1}{\sqrt{2}}&-\dfrac{1}{\sqrt{6}}\\\dfrac{1}{\sqrt{3}}&\dfrac{1}{\sqrt{2}}&-\dfrac{1}{\sqrt{6}}\\\dfrac{1}{\sqrt{3}}&0&\dfrac{2}{\sqrt{6}}\end{array}\right]$$ $R$ associates to each vector $s=(x,y,z)^T$, the vector $$R(s)=A\left[\begin{array}{c}x\\y\\z\end{array}\right]$$