Distance of a point from a line

130 Views Asked by At

Let $w\in\mathbb{R}^{2}$ be a vector and denote $W=sp\{w\}$. Then $W^{\perp}$ is also a one dimensional space i.e is a line, denote this line as $l_{w}$.

Given a line we can shift it from the origin by a real number $b$: $l_{w}+b$ is an affine space.

In a video lecture from Coursera I saw that given a point $A=(x_{A}^{(1)},x_{A}^{(2)})$ the distance from $A$ to $l_{w}$ was claimed to be $$ |\langle A-M,w\rangle| $$

where $M$ is a point on $l_{w}$.

Can someone please explain this equality to me ?

The following is a screenshot from the lecture that should illustrate the situation

enter image description here

1

There are 1 best solutions below

2
On BEST ANSWER

First of all, remember that if we have two vectors $\vec{u},\vec{v}$ then the orthogonal projection of $\vec{u}$ over $\vec{v}$ is given by $$\frac{\vec{u}\cdot \vec{v}}{|\vec{v}|}.$$

In your case, the distance from the point $A$ to the line is the distance from $H$ to $A.$ Of course, one can get explicitly $H$ and get the distance. However this is not necessary. Note that $|\vec{HA}|$ is the orthogonal projection of $\vec{AM}$ over $\vec{w}$ (and $M$ can be any point belonging to the line). This projection is given by

$$\frac{\langle \vec{AM},\vec{w}\rangle}{|\vec{w}|}.$$

If you assume that $\vec{w}$ is unitary then you get the expression

$$\langle \vec{AM},\vec{w}\rangle.$$