[Math] Orthogonal projection of a point onto a line

analytic geometrygeometrylinear algebramatrices

How would I go about solving the following problem?

Find an orthogonal projection of a point T$(-4,5)$ onto a line $\frac{x}{3}+\frac{y}{-5}=1$.

Best Answer

I'd like to solve the problem using orthogonal projection matrices.

If the line is passing through the origin, it will be very simple to find the orthogonal projection. Suppose $p$ is the given point, $v$ is the given line (passing through the origin, so represented by a vector). Then the orthogonal projection point is $$\frac{vv^T}{v^Tv}p$$

Now the given line does not pass through the origin. But it can be convert to the simple problem above. Choose a point $p_0=(x_0,y_0)^T$ on the given line. Move the origin to $p_0$ (later move back). Then the line can be represented by a vector $v$, and the original given point becomes $p_1=p-p_0$. Now compute $\frac{vv^T}{v^Tv}p_1$. Then move the origin back, we get the orthogonal projection in the original coordinate system is $$\frac{vv^T}{v^Tv}(p-p_0)+p_0=\frac{vv^T}{v^Tv}p+\left(I-\frac{vv^T}{v^Tv}\right)p_0$$.

enter image description here

Specifically, for your problem, $p=(-4,5)^T$. Choose $p_0=(0,-5)^T$, then $$\frac{vv^T}{v^Tv}p+\left(I-\frac{vv^T}{v^Tv}\right)p_0=(\frac{57}{17},\frac{10}{17})^T$$