Given $x,y,z$ axis of an original coordinate system as $(1,0,0)$, $(0,1,0)$ and $(0,0,1)$, assume that we have new $x$ and $y$ axis defined as $(a,b,c)$ and $(d,e,f)$ where $x,y$ are orthonormal, of course. Then, we can partially define a rotation matrix, $R \in SO(3)$ using $(a,b,c)$ and $(d,e,f)$ as its first 2 columns.
$R = \begin{bmatrix}a&d&?\\b&e&?\\c&f&?\end{bmatrix}$
My questions is: can we derive a unique last column of $R$ mathematically with the given information?
Intuitively, we can easily draw $z$ axis when $x,y$ are defined. However, when I tried to specify a $z$ axis using $x,y$ axis and properties of a rotation matrix (e.g., columns are orthonormal), there were always 2 pairs of the $z$ axis ($z_1$, $z_2$), where $z_1 = -z_2$.
First the definition of the special orthonormal group in $\mathbb{R}^3$ is $SO(3)=\{A\in GL(n,\mathbb{R})|\,A^TA=AA^T=I,\,\det(A)=1\}$. Now we take the matrix $$ A=\begin{pmatrix} a & d & z_1\\ b & e & z_2\\ c & f & z_3 \end{pmatrix} \in SO(3) $$
and want to find $z:=(z_1,z_2,z_3)^T$ where we know $x:=(a,b,c)^T$ and $y:=(d,e,f)^T$. Because of the orthogonality of $A$, we have that $x$ and $y$ are orthogonal to $z$. So we get $$0=x\cdot z=az_1+bz_2+cz_3$$ $$0=y\cdot z=dz_1+ez_2+fz_3$$ Because of $\det(A)=1$ we get that $$1=\det(A)=aez_3+cdz_2+bfz_1-cez_1-afz_2-bdz_3=$$ $$=(bf-ce)z_1+(cd-af)z_2+(ae-bd)z_3$$ Now we have three linear equations that give us the matrix equation $$ \underbrace{\begin{pmatrix} a & b & c\\ d & e & f\\ bf-ce & cd-af & ae-bd \end{pmatrix}}_{B:=} \begin{pmatrix} z_1\\ z_2\\ z_3 \end{pmatrix} = \begin{pmatrix} 0\\ 0\\ 1 \end{pmatrix} $$ Take the inverse of $B$ and voilá. There's your $z$ $$z=B^{-1}e_3$$ You may check with mathematica that $B$ is actually orthogonal and therefore invertible. Because of that your $z$ is also unique. Hope that answers it.