# Least Squares Construction

Let $L \subset \mathbb{R}^2$ be a line through the origin, and let b $\in \mathbb{R}^2$ be any point.

a.) Find a geometrical construction of the closest point v $\in L$ to b when the distance is measured in the standard Euclidean norm.

b.) Use your construction to prove that there is one and only one closest point.
c.) Show that if $0 \ne$ a $\in L$, the the distance equals $\frac{\sqrt{||a||^2||b||^2 - (a * b)^2}}{\|a||} = \frac{|a\times b|}{||a||}$.

My attempt:

a.)Let $l_1,l_2$ be a basis for L. Then the general element of $v \in L$ is a linear combination of the basis vectors. Thus, $x_1l_1 + x_2l_2 = Ax$ is the m x n matrix formed by the basis vectors and x = $(x_1,x_2)^T$ are the coordinates of v. So, the closest point in L to b is $||v-b||^2 = ||Ax - b||^2$ over all possible $x \in \mathbb{R}^n$.

b.) I do not know how to do this

c.) I do not know how to do this

-
If $L$ is a line through the origin of ${\bf R}^2$, then it is one-dimensional, and any basis for it consists of a single vector, not a pair of vectors. You are dealing in colorless green ideas again. – Gerry Myerson Oct 22 '12 at 22:15
Thank you a lot Gerry for clearing that up once again! You are great! – diimension Oct 23 '12 at 0:03

(a) is a projection. You draw a perpendicular $P$ through the line $L$, passing through the point $b$. The closest point is the point on $L$ through which the perpendicular $P$ passes.
(b) By Euclid's axioms (I believe #5), $P$ exists and is unique. It also must intersect $L$ in exactly one place, and so the resulting projection is unique as well.
@diimension The origin, $b$ and the point of projection (say $x$) form a right-angled triangle, where $\vec{x} = k \vec{a}$ for some $k \in \mathbb{R}$, since they lie on the same line. The trick is, what is the value of $k$? – gt6989b Oct 22 '12 at 21:23
So since $k \in \mathbb{R}$ is a scalar then k = $\frac{\vec{x}}{\vec{a}}$ ? – diimension Oct 22 '12 at 21:33
@diimension You cannot divide vectors. But you have to compute by how much to scale $\vec{a}$ to get exactly $\vec{x}$. You probably want to use the $\cos$ of the angle between $\vec{a}$ and $\vec{b}$ to compute $\vec{x}$ (i.e. dot product will come in handy) ... – gt6989b Oct 23 '12 at 15:50