I am struggling to understand what the different parts of the Gram-Schmidt process represent.
Suppose we have a basis $\{x_1, x_2\}$
We would then find a orthogonal basis by doing the following :
$$v_1 = x_1$$
$$v_2 = x_2 - \frac{x_2 \cdot v_1}{v_1 \cdot v_1}v_1$$
My question is : what does $ x_2 \cdot v_1$ represent and why do we divide it by $v_1 \cdot v_1$.
What I would have done is assign $v_1 = x_1$ and divide it by its length to have a orthonormal vector in the direction of $x_1$ but how do we then find the orthogonal component of $v_2$ when projecting it on to $v_1$?
Drawing a picture might help you. The idea behind the procedure is to remove from $x_2$ the part that is parallel to $x_1$. To calculate this part you need to find the projection of $x_2$ onto the axis defined by $x_1=v_1$. For that you need to divide $x_2\cdot v_1$ by the length of $v_1$. Now that you have the "length" of the parallel part, you need the direction. The direction is obviously just $v_1$ divided by its length. Multiply the two together and you get the second term. Now you just subtract that from $x_2$ and you have gotten rid of its parallel part.
Of course at this stage $v_1$ and $v_2$ are not normalized, but you can fix that later by dividing by their length.