The distance between two points is the distance between the vector

representing those two points which would be the distance

between those two tips of those two points.

So, the distance from x to y,

and we'll take it squared because we want to avoid square root symbol,

is equal to the length of the vector from x to y or actually from y to x.

Remember, the length of a vector is

the inner product of the vector with itself so we can write it this way.

Now, we can expand it using all the rules

that we were talking about in our previous lecture,

the distributed rule and various other rules is

as x transpose x plus y transpose y minus 2x transpose y,

and this is represented in this picture.

So, the vector from y to x,

you started off at this point,

you go down until the origin,

and then you go up to x,

and this gives you the x minus y vector,

and the distance between those two vectors is the length of this vector.

We can look at minus y instead of starting at the origin.

Instead of following y, we go in the minus y direction.

If we start from minus y go to x,

we get the vector x plus y.

This is the negative of minus y so we follow y and then we follow x,

so this is the sum of the two vectors.