Solution (source code)

= Solution

The <dot product> with the given <unit vector> is $\mathbf r\cdot\hat{\mathbf n}=(x+z)/\sqrt2$. Subtracting the corresponding <orthogonal projection> gives
$$
\mathbf r-\hat{\mathbf n}(\mathbf r\cdot\hat{\mathbf n})=\left(\frac{x-z}{2},y,\frac{z-x}{2}\right)^T.
$$
Taking its squared <Euclidean norm> yields the equivalent <Cartesian coordinates>[Cartesian] equation
$$
\boxed{\frac{(x-z)^2}{2}+y^2=4}.
$$