Mechanism Behind Dot Product and Least Square

Sorry for my ignorance, but I want to know how the mechanism of finding the least square solutions or the closest points in Euclidean space works.

For example:

Find the closest point or points to $b =(−1,2)^T$ that lie on the line $x + y = 0$.

$$\frac{\left( \begin{matrix} -1 \\ 2 \end{matrix} \right) \cdot \left( \begin{matrix} 1 \\ -1 \end{matrix} \right)}{\left( \begin{matrix} 1 \\ -1 \end{matrix} \right) \cdot \left( \begin{matrix} 1 \\ -1 \end{matrix} \right)} \cdot \left( \begin{matrix} 1 \\ -1 \end{matrix} \right) = \left( \begin{matrix} -\frac{3}{2} \\ \frac{3}{2} \end{matrix} \right)$$

But what does the dot product between $\left( \begin{matrix} -1 \\ 2\end{matrix} \right) \cdot \left( \begin{matrix} 1 \\ -1 \end{matrix} \right)$ tell you? If I commute it the answer is $-3$, but what exactly is $-3$? Also, the denominator is $2$, again, what exactly is $2$ telling us here?

-

The projection onto a vector $x$ is give by $$Pv=\frac{xx^T}{||x||^2}v,$$ where $P \equiv \frac{xx^T}{||x||^2}$ is the projection operator, and $||x||^2=(x,x)$ (or $x*x$ in your notation) is the normalization factor.

-
I haven't learned projections yet, can you clarify what it exactly means? –  diimension Oct 16 '12 at 2:26
Projections is exactly what I was looking for! My book never mentioned it when discussing this. Thank you very much, Chaohuang! –  diimension Oct 16 '12 at 3:00
Thus, when you perform a transform such as $\frac{y^Tx}{x^Tx} = \frac{y\cdot x}{x\cdot x}$ you are dividing by the sum of the squares of $x$. The sum of the squares of a vector is, of course, the square of the distance of that vector from the origin.