AI Tutor
If you are standing in an open field at coordinates (x0,y0)(x_0, y_0) and need to reach a straight road as quickly as possible, which exact path should you take?
The shortest path from a point to any line is always the perpendicular segment β€” the straight line meeting the boundary at a 90∘90^\circ angle.
Can we calculate this exact shortest distance in a single step without solving for the intersection point each time?

The Perpendicular Distance Formula

A straight line in standard Cartesian form is written as Ax+By+C=0Ax + By + C = 0, where AA, BB, and CC are constant real coefficients.
The perpendicular distance dd from any given point (x0,y0)(x_0, y_0) to the line Ax+By+C=0Ax + By + C = 0 is:
d=∣Ax0+By0+C∣A2+B2d = \frac{|Ax_0 + By_0 + C|}{\sqrt{A^2 + B^2}}
Why does the numerator look exactly like the line equation, and where does the square root in the denominator come from?

Why It Works: Vector Projection

In the late 1700s, French mathematician Gaspard Monge systematized coordinate methods to calculate distances and projections for military engineering and architecture.
Every line Ax+By+C=0Ax + By + C = 0 has a normal vector n=⟨A,B⟩\mathbf{n} = \langle A, B \rangle that points perpendicular to the line with magnitude ∣n∣=A2+B2|\mathbf{n}| = \sqrt{A^2 + B^2}.