Calculate the distance $d$ from $\vec{y}$ to the straight line through $\vec{u}$ and the origin

463 Views Asked by At

Background

Let $$\vec{y}= \left[ {\begin{array}{cc} 5 \\ 1 \\ 10 \\ \end{array} } \right]$$

and $$\vec{u}=\left[ {\begin{array}{cc} -7 \\ 3 \\ -3 \\ \end{array} } \right]$$

Calculate the distance $d$ from $\vec{y}$ to the line through $\vec{u}$ and the origin.

My work so far

Using the formula

$$d=\left|\vec{y}-\frac{\vec{y}\cdot\vec{u}}{|\vec{u}|}{\vec{u}}\right|$$

and plugging in

$$d=\left|\begin{pmatrix}5\\1\\10\end{pmatrix}-\frac{-62}{67}\begin{pmatrix}-7\\3\\-3\end{pmatrix}\right|$$

and then calculating

$$\frac{11\sqrt{38}}{\sqrt{67}}=8.284133.$$

Am I on the right track here? Or, where did I go wrong?