How to deterministically pick a vector that is guaranteed to be non-parallel to the given one? I have a unit vector $u = (x1, y1, z1)$ in $R^3$, given $(x1, y1, z1)$ are known rational numbers.
I need to deterministically pick a unit vector $v = (x2, y2, z2)$, such that $v$ and $u$ are not parallel, so ||${\bf u} \times {\bf v}$|| $\neq 0$.
$x2, y2, z2$ values can likely be derived from $x1, y1, z1$, but I can't figure out how exactly.
 A: If $z1=\pm 1$, then the unit vector is completely determined, $u=(0, 0,\pm 1)$, so you can take $v=(0, \pm 1,0)$ for example. Note that this is an equivalence, $|z1|
=1 \Longleftrightarrow x1=y1=0$
If $z1 \neq \pm 1$ then take $v=(-y1, x1, z1) $. The $z$ coordinate in the cross product is $x1^2 +y1^2$ which is different from zero. 
A: Based on the answer you accepted, your notion of “deterministic” allows conditional evaluation. In that case, for any vector $\mathbf v = (x,y,z)\ne0$, the vectors $(0,z,-y)$, $(-z,0,x)$ and $(y,-x,0)$ (which are the cross products of $\mathbf v$ with the standard basis vectors) are all orthogonal to $\mathbf v$. At least two of them are nonzero: choose one. You can make this choice deterministic by always taking, say $(0,z,-y)$ unless that is zero, in which case take $(-z,0,x)$.
A: You can just rotate $u$ 90° in the x-axis and then 90° in the y-axis, for example. The intersection of the invariant sets under these transformations is $\left\{\left(0, 0, 0\right)\right\}$, and so the result is guaranteed to be neither $u$ nor $-u$.
In 3D the rotation matrices are:
$\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 $u = \left(x, y, z\right)$, then the result of this transformation is $u' = \left(z, x, y\right)$, which is of course just a permutation of the entries of the vector.
