Matrix with orthonormal base I have the two following given vectors:
$\vec{v_{1} }=\begin{pmatrix} 0 \\ 1 \\ 0 \end{pmatrix}$
 $\vec{v_{2} }=\begin{pmatrix} 3 \\ 0 \\ -3 \end{pmatrix}  $
I have to calculate matrix $B$ so that these vectors in $\mathbb{R}^{3}$ construct an orthonormal basis.
The solution is: 
$$B=\begin{pmatrix} 0 & -\frac{\sqrt{2} }{2}  & \frac{\sqrt{2} }{2}  \\ 1 & 0 & 0 \\ 0 & -\frac{\sqrt{2} }{2}  & -\frac{\sqrt{2} }{2}   \end{pmatrix}$$
I really don't have any idea how to get this matrix. I'm also confused because I only have 2 vectors.
 A: Maybe these calculations would help you.
We need to find vertor $\vec{v}_3$ such that $\vec{v}_3\perp\vec{v}_1$ and $\vec{v}_3\perp \vec{v}_2$, i.e. 
$$
\begin{cases}
(\vec{v}_1, \vec{v}_3) = 0, \\
(\vec{v}_2, \vec{v}_3) = 0.
\end{cases}
$$
Here $(\vec{x},\vec{y})$ is a scalar product of vectors $\vec{x}$ and $\vec{y}$.
If we denote $\vec{v}_3$ as $(x_1,x_2,x_3)^T$ we get the system
$$
\begin{cases}
0\cdot x_1 + 1\cdot x_2 + 0\cdot x_3 = 0, \\
3\cdot x_1 +0\cdot x_2 - 3\cdot x _3 = 0
\end{cases} \iff 
\begin{cases}
x_2 = 0, \\
3x_1 - 3x_3 = 0
\end{cases}\iff 
\begin{cases}
x_2 = 0, \\
x_1 = x_3.
\end{cases}
$$
So vector $\vec{v}_3$ is depends on one parameter $x$ and has form $(x,0,x)^T$. 
Then we need to normalize this system, i.e. calculate vectors $\vec{u}_i = \dfrac{\vec{v}_i}{||\vec{v}_i||}$. We get
$$
\vec{u}_1 = \frac{1}{\sqrt{1^2}}
\begin{pmatrix}
0 \\ 1 \\ 0
\end{pmatrix} = 
\begin{pmatrix}
0 \\ 1 \\ 0
\end{pmatrix};
$$
$$
\vec{u}_2 = \frac{1}{\sqrt{3^2 + (-3)^2}}
\begin{pmatrix}
3 \\ 0 \\ -3
\end{pmatrix} = 
\begin{pmatrix}
\frac{\sqrt{2}}{2} \\ 0 \\ -\frac{\sqrt{2}}{2}
\end{pmatrix};
$$
$$
\vec{u}_3 = \frac{1}{\sqrt{x^2 + x^2}}
\begin{pmatrix}
x \\ 0 \\ x
\end{pmatrix} = 
\begin{pmatrix}
\frac{\sqrt{2}}{2} \\ 0 \\ \frac{\sqrt{2}}{2}
\end{pmatrix}.
$$
One may see that system of vectors $(\vec{u}_1,\vec{u}_2,\vec{u}_3)$ is orthonormal.
A: the two given vectors v1 and v2 spans a subspace of R3. to construct the matrix is just same as finding a set of orthonormal basis using the given two.
 now, here the given vectors are orthogonal to each other and the first vector has modulus 1. so, we shall normalize the second vector. 
now, let's name the subspace generated by these two vectors as H. to complete the solution we need to pick a vector from Hperp (the subspace consisting all vectors perpendicular to H) and normalize it to make a unit vector.
that can be done by first calculating H and then by picking a vector v from compliment of H in R3. then we apply gram-schmidt process to v to extract the vector part of Hperp out of v.then we can normalize it to make an orthonormal basis.
p.s. the answer you have given, is just one such matrix. there are other set of o.n. basis which satisfies the provided conditions.   
A: The 3rd vector can be cross product of the given two vector $v_1$ and $v_2$.
$$v_3=v_1 \times v_2=(\begin{array}-3 & 0 & -3 \end{array})$$
You already know that  $v_1$ and $v_2$ are orthogonal. So the rest to do is to normalize the vectors. 
