Rearranging cylinder equation Given this equation $(x-y)^2+(y-z)^2+(z-x)^2=r^2$, which when plotted for some radius $r$ results in a "rotated" cylinder:
Plotted equation with $r=1$
Is it possible to rearrange this equation to a form where to rotation is clearer? Perhaps to something around the lines of $(\overrightarrow{p}-\overrightarrow{c})^2=r^2+(\overrightarrow{d}\bullet(\overrightarrow{p}-\overrightarrow{c}))^2$, where $\overrightarrow{p}$ is a point on the cylinder and the centre-axis of the cylinder is defined by a point $\overrightarrow{c}$ on the axis and the axis' directions $\overrightarrow{d}$.
Is a rearranging even needed or can the rotation be easily read from the original equation?
 A: We have
$ \begin{bmatrix} x - y \\ y - z \\ z - x \end{bmatrix} = \begin{bmatrix} 1 && - 1 && 0 \\  0 && 1 && - 1 \\ -1 && 0 && 1 \end{bmatrix} \begin{bmatrix} x \\ y \\ z \end{bmatrix}$
Therefore,
$(x - y)^2 + (y - z)^2 + (z - x)^2 = \begin{bmatrix} x && y && z \end{bmatrix} \begin{bmatrix} 1 && 0 && -1 \\ -1 && 1 && 0 \\ 0 && -1 && 1 \end{bmatrix} \begin{bmatrix} 1 && - 1 && 0 \\  0 && 1 && - 1 \\ -1 && 0 && 1 \end{bmatrix} \begin{bmatrix} x \\ y \\ z \end{bmatrix} $
Which simplifies to
$ (x - y)^2 + (y - z)^2 + (z - x)^2 = \begin{bmatrix} x && y && z \end{bmatrix} \begin{bmatrix} 2 && -1 && -1 \\ -1 && 2 && -1 \\ -1 && -1 && 2 \end{bmatrix} \begin{bmatrix} x \\ y \\ z \end{bmatrix} $
Now,
$\begin{bmatrix} 2 && -1 && -1 \\ -1 && 2 && -1 \\ -1 && -1 && 2 \end{bmatrix}  = \begin{bmatrix} 3 && 0 && 0 \\ 0 && 3 && 0 \\ 0 && 0 && 3 \end{bmatrix} - \begin{bmatrix} 1 && 1 && 1 \\ 1 && 1 && 1 \\ 1 && 1 && 1 \end{bmatrix} $
The last matrix can be factored as follows
$\begin{bmatrix} 1 && 1 && 1 \\ 1 && 1 && 1 \\ 1 && 1 && 1 \end{bmatrix} = \begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix} \begin{bmatrix} 1 && 1 && 1 \end{bmatrix} $
So that,
$(x - y)^2 + (y - z)^2 + (z - x)^2 = p^T ( 3 I - v v^T ) p = 3 p^T (I - u u^T ) p  $
where $ p = [x, y, z]^T $ and $v = [1, 1, 1]^T $ and $ u = \dfrac{1}{\sqrt{3}} v $
It follows that
$ p^T ( I - u u^T ) p = \dfrac{r^2}{3} $
And this is the equation of a cylinder of radius $\dfrac{r}{\sqrt{3}} $ with an axis along $ u $ ( or $v$ ) that passes through the origin.
A: With the orthonormal change of coordinates
$$(s,t,u) = \left(\frac1{\sqrt{3}}(x + y + z), \frac{1}{\sqrt{2}}(x - y), \frac1{\sqrt{6}}(x + y - 2z)\right)$$
the equation becomes
$$2t^2 + \frac12(\sqrt{3} u - t)^2 + \frac12(\sqrt{3} u - t)^2 = r^2$$
or equivalently,
$$t^2 + u^2 = \frac13 r^2 .$$
This is a right cylinder on a circle of radius $r/\sqrt{3}$ around the origin in the $(t, u)$ plane (ie the $x + y + z = 0$ plane).
The exact choice of the $t$ and $u$ axes on that plane are not important, I just chose the unit vector along $(1, -1)$.
