[Math] Easiest way to find the (shortest) distance between a point and a line in $3$-space

geometrymultivariable-calculus

I have tried doing some research on this and am looking for the easiest way to compute this distance. For example, Let $l$ be the line determined by $x=y=z$. Find the shortest distance from this line to the point $(a, b, c)$. What is the easiest way to approach this?

Edit: Form is not important, assume we know the direction vector $\vec v$ and a point on the line $P$.

Best Answer

First, draw a picture. Let $Q$ be the point $(a,b,c)$ and let $\theta$ be the angle between the vectors $\vec{v}$ and $\vec{PQ}$. Then, the point $R$ on the line $\ell$ which is closest to $Q$ is the point such that $\angle QRP = 90^{\circ}$, i.e. $QR$ is perpendicular to $\ell$. Then, the shortest distance from $Q$ to $\ell$ is $\|\vec{QR}\| = \|\vec{PQ}\|\sin\theta$. Using the formula $\|\vec{PQ} \times v\| = \|\vec{PQ}\|\|\vec{v}\|\sin\theta$, we get $\|\vec{QR}\| = \|\vec{PQ}\|\sin\theta = \dfrac{\|\vec{PQ} \times v\| }{\|v\|}$.

Alternatively, Google "distance between a point and a line" and click on the Wikipedia article.