I want to calculate the distance of the vector $x=(1,1,1,1)$ to the subspace $\{(1,0,2,0) , (0,1,0,2)\}$
I have solved this in 2 ways that I know of but the thing is, the results are different.
For instance when I use $||x-Pr(x)||$ I get $\sqrt{2}$, but when I calculate it using the gram determinant (more info here: Distance between a point and a m-dimensional space in n-dimensional space ($m<n$) ) I get $\sqrt{\frac{10}{25}}$ which is weird because both ways should be equivalent.
So my question is, what am I missing here? Which one of these result was the correct one?
Thank you.
Edit: Solution using $||x-Pr(x)||$ :
Let $v_1$ be $(1,0,2,0)$ and $v_2$ be $(0,1,0,2)$
Both vectors $v_1$ and $v_2$ are orthogonal meaning the inner product of them is $0$. Now we need to make them orthonormal. After doing so we get $e_1=v_1/\sqrt{3}$ and $e_2=v_2/\sqrt{3}$
Now we calculate $\Pr(x)$.
$$\Pr(x)= (x,e_1)e_1+(x,e_2)e_2 =\ldots= (1,1,2,2)$$
Therefore the distance is $d(x,U)= ||x-\Pr(x)||=||(1,1,1,1)-(1,1,2,2)||= ||(0,0,-1,-1)||= \sqrt{2}$