# Compute the orthogonal projection $w$ of $u$ on a line $L$

A vector $u$ and a line $L$ in $\mathbb{R}^2$ are given. Compute the orthogonal projection $w$ of $u$ on $L$, and use it to compute the distance $d$ from the endpoint of $u$ to $L$

$u = \begin{pmatrix} 5 \\ 0 \end{pmatrix}$

$y = 0$

I know to that $w = \frac{u \cdot v}{||v||^2}v$

and that $d = u - w$

The answer in the book says the answer is $w = \begin{pmatrix}5 \\0 \end{pmatrix}$ and $d = 0$

How do I find $v$ to solve the problem?

• What is your line $L$? Is it the line given by the equation $y = 0$? – Eli Rose Dec 14 '15 at 4:16
• Yes, the book only gives $u$ and the equation of Line $L$ – user273323 Dec 14 '15 at 4:25

The vector $v$ can be any vector in the direction of the line $L$. For a line $ax + by = c$, the vector $\begin{pmatrix}b\\-a\end{pmatrix}$, or any non-zero multiple of it, lies in the direction of the line. So for $L: y=0$, alias $0x+1y=0$, the vector $v = \begin{pmatrix}1\\0\end{pmatrix}$ will do. Put this into your equation gives $w=\begin{pmatrix}5\\0\end{pmatrix}$ as expected.
Or, more simply, you can observe that $u$ is a vector parallel to the direction vector for the Line $L$ , that is it can play the role of direction vector for $L$. So $u$ and $L$ are parallel and then the orthogonal projection of $u$ onto the line is the same vector $u$. Distance,finally, will be obviously $0$,since the point $A(5,0)$ belongs to the line $L$.