The quaternion $q=\cos(\pi/4) + \sin(\pi/4) \mathbf i + \sin (\pi/4)\mathbf j$ should rotate any 3D vectors around the bisecting line in the first quadrant of the $x,y$ plane $\pi/2 = 90^o.$ From Wolfram Alpha:
However, if I take the vector $(3,-4,7)$ and conjugate it:
$$\begin{align}\small (\cos(\pi/4) + \sin(\pi/4) \mathbf i + \sin (\pi/4)\mathbf j)(0 + 3\mathbf i -4 \mathbf j + 7 \mathbf k)(\cos(\pi/4) - \sin(\pi/4) \mathbf i - \sin (\pi/4)\mathbf j)\\= 0 + 9/2 \mathbf i - 6 \mathbf j - 21/2 \mathbf k\end{align}$$
But the vector $(9/2, -6,-21/2)$ doesn't look like a ninety degree rotation around $(\sin(\pi/4),\sin(\pi/4),0)$:
What obvious issue am I overlooking?


Of course it had to be a silly overlook, and it was.
For a $3$D vector $\mathbf v=(3,-4,7)$ to rotate around the axis of another vector $(v_1,v_2,v_3)$ using quaternions the vector $\mathbf v$ has to be thought of as pure quaternion (real part equal to zero), $\small 0 + 3 \mathbf i -4 \mathbf j + 7 \mathbf k$ conjugated by the quaternion defined by a unit vector $v_1 \mathbf i + v_2 \mathbf j + v_3 \mathbf k.$ If the axis-angle of the rotation is $\small (v_1,v_2,v_3,\phi)$ the axis vector must $\small v_1^2 + v_2^2 + v_3^2=1,$ and the rotation quaternion will be $\small \cos\left(\frac{\phi}2 \right)+v_1\sin\left(\frac{\phi}2\right) \mathbf i + v_1\sin\left(\frac{\phi}2 \right) \mathbf j + v_1\sin\left(\frac{\phi}2\right) \mathbf k.$ Therefore, $\small \cos(\pi/4) + \sin(\pi/4) \mathbf i + \sin (\pi/4)\mathbf j + 0 \mathbf k,$ in the OP, has to be normalized: this is achieved by simply turning the quaternion into $\small \mathbf q=\left(\cos\left(\frac{\pi}4\right)+ \sin\left(\frac{\pi}4\right)/\sqrt{2}\;\mathbf i + \sin\left(\frac{\pi}4\right)/\sqrt{2}\;\mathbf j + 0 \mathbf k )\right).$
Now the conjugation does what is intended:
Conjugating the vector $(3,-4,7),$
$$\begin{align} &\mathbf q\mathbf v \mathbf q'=\\ &=\Tiny \left(\cos\left(\frac{\pi}4\right)+ \frac{\sin\left(\frac{\pi}4\right)}{\sqrt{2}}\mathbf i + \frac{\sin\left(\frac{\pi}4\right)}{\sqrt{2}}\mathbf j + 0 \mathbf k )\right)(0+3\mathbf i-4\mathbf j +7\mathbf k)\left(\cos\left(\frac{\pi}4\right)- \frac{\sin\left(\frac{\pi}4\right)}{\sqrt{2}}\mathbf i - \frac{\sin\left(\frac{\pi}4\right)}{\sqrt{2}}\mathbf j + 0 \mathbf k )\right)\\ &=\Tiny \left(\cos\left(\frac{\pi}4\right)+ \frac{\sin\left(\frac{\pi}4\right)}{\sqrt{2}}\mathbf i + \frac{\sin\left(\frac{\pi}4\right)}{\sqrt{2}}\mathbf j + 0 \mathbf k )\right)(0+3\mathbf i-4\mathbf j +7\mathbf k)\left(\cos\left(-\frac{\pi}4\right) + \frac{\sin\left(-\frac{\pi}4\right)}{\sqrt{2}}\mathbf i + \frac{\sin\left(-\frac{\pi}4\right)}{\sqrt{2}}\mathbf j + 0 \mathbf k )\right)\\ &=\tiny \left(0 -\frac 1 2 +\frac{7}{\sqrt 2}\mathbf i -\frac 1 2 -\frac{7}{\sqrt 2}\mathbf j + -\frac{7}{\sqrt 2} \mathbf k )\right)=\small\color{red}{0 + 4.44975\mathbf i -5.44975\mathbf j -4.94975 \mathbf k}\\ &=\Tiny\color{blue}{\begin{bmatrix}1/2 & 1/2 & 1/\sqrt{2}\\ 1/2 & 1/2 & -1/\sqrt{2}\\ -1/\sqrt{2}& 1/\sqrt{2} &0 \end{bmatrix}}\begin{bmatrix}3\\-4\\7\end{bmatrix} \end{align}$$
The last step is the rotation matrix from angle and axis, which yields the same result as the conjugation with a simple matrix multiplication.
Here is the Wolfram Alpha query
I stitched together some R functions to do all these operations:
So I can replicate the rotation matrix (in blue above):
Or get the rotation in $3$D (as above in red) by using the rotation form of the quaternion:
Or by considering that $(\cos \frac \theta 2 + \sin \frac \theta 2 (v_1 \mathbf i + v_2 \mathbf j + v_3 \mathbf k))$ is the quaternion that allows us to rotate by $\theta$ (after conjugation) around the $3$D vector $\left(v_1,v_2,v_3\right),$ use the alternative function entering the degrees (converted to radians inside the function) to get the same result:
Visualized here in reference to the vector $\small (\sin(\pi/2)/\sqrt 2,\sin(\pi/2)/\sqrt 2, 0)=(1/2,1/2,0)$:
We can try using a different axis, say the vector $(2,3,4),$ and going around the clock with two other vectors, for example, $(3,-4,7)$ and $(-4,-3,3)$:
Code here.
One final observation is that while the axis of rotation is normalized (within the function
rotate.theta.around()), there is no need to normalize the vector in $3$D that we want to rotate. For example, applying the functions above to $(1,1,1)$ with and without normalizing, and rotating around $(0,1,0)$ around the clock will yield simply scaled vectors: