Visual walkthrough — Distance from a point to a line
Step 1 — What is a point, what is a line, what are we even measuring?
WHAT. We have a single dot in the plane. We call it . Its address — how far right, how far up — is written . The little is just a name-tag so we don't confuse our point with the wandering points that live on the line.
We also have a straight line . We write it as
Read this out loud: "a point sits on the line exactly when comes out to zero." The letters are fixed numbers that describe the line — its tilt and its position — and are the free coordinates of whatever point we test.
- and together set the direction the line points.
- slides the line toward or away from the origin.
WHY this form and not . The slope form breaks for a vertical line (slope is infinite). The form never breaks — a vertical line is just . Because we want every line, we commit to this form.
PICTURE. Point off to one side, the line marching across, and the thing we want: the shortest hop from to , drawn in red.

Step 2 — Why the shortest path is the perpendicular one
WHAT. Of all the ways to walk from down to the line, one is shortest. Claim: it is the one that hits the line at a right angle (a perfect corner, ).
WHY. Pick any other landing point on the line. Now you have a triangle: the perpendicular drop is one leg, the slanted walk is the hypotenuse (the longest side of a right triangle). The hypotenuse is always longer than a leg. So every slanted path loses to the perpendicular one. This is why the whole problem is really about the perpendicular direction.
PICTURE. The perpendicular drop in red; two slanted alternatives in black, each visibly longer, each forming a right triangle with the red leg.

Step 3 — The arrow that points straight across: the normal vector
WHAT. A vector is just an arrow: it has a direction and a length. The special arrow — built from the same and in the line's equation — points perpendicular to the line. It is called the normal vector.
WHY is perpendicular to the line? Take two points on the line, and . Both satisfy the equation: Subtract the two lines. The 's cancel and you get That left side is exactly the dot product of with the arrow along the line. A dot product of zero means the two arrows meet at a right angle (see Projection of Vectors). So . That is the whole reason and show up in the answer: they are the perpendicular direction we need to measure along.
PICTURE. The line, and the red normal arrow shooting straight out of it at .

Step 4 — Stand on the line, look at : the connecting arrow
WHAT. Plant your feet at any point that lies on the line. Since is on : a x_0 + b y_0 + c = 0 \quad\Longrightarrow\quad a x_0 + b y_0 = -c. \tag{$\star$} Keep equation in your pocket — we cash it in at Step 6.
Now draw the arrow from your feet to the point : Each slot is "target minus start": how far right and how far up you'd travel from to reach .
WHY. We don't yet know the true perpendicular foot. But we do know how to reach from some point on the line. In the next step we'll strip away the useless sideways part of this arrow and keep only the part pointing across — which is the distance.
PICTURE. sitting on the line, the black arrow slanting up to , and the red normal still poking out.

Step 5 — Casting a shadow: the projection onto the normal
WHAT. The arrow points partly along the line and partly across it. The "across" part is our distance. To extract it, we project onto the normal direction — we ask: how much of lies in the direction of ?
The tool that answers "how much of one arrow lies along another" is the dot product divided by the length of the direction arrow:
WHY the dot product and not something else. The dot product measures overlap of direction. When we dot with the unit normal (length 1), the answer is literally the length of 's shadow on the normal line — precisely the perpendicular gap. The sideways part contributes zero because it is at to (its kills it). That is exactly what we want: the sideways travel should not count toward "distance to the line."
PICTURE. The black , its shadow dropped onto the red normal direction, and that shadow's length labelled .

Step 6 — Plug in and watch appear
WHAT. Write out the dot product term by term:
Now cash in equation from Step 4, which said :
WHY this is the punchline. The mystery point has vanished. Its coordinates were eaten by the relation , leaving only 's coordinates and the line's constant . This is why we could stand on any point of the line — the answer never depended on which one.
Divide by (Step 3) and take absolute value (Step 5):
Every symbol is now earned: = normal direction, = the shift that ate , the bars = distances can't be negative, the root = the normal's length.
Step 7 — The degenerate cases (so you never get surprised)
WHAT / WHY / PICTURE, three quick edge cases the formula still handles:
- is on the line. Then , so . The red segment shrinks to a dot. ✓
- Vertical line, (e.g. , i.e. , so ). The slope form would explode, but here and — the plain horizontal gap. ✓
- Horizontal line, (, i.e. ). Then — the plain vertical gap. ✓
- Two parallel lines and : pick any point on the first, drop it into the second, and everything but cancels, giving .

The one-picture summary
Everything in a single frame: point , line , the red perpendicular drop , the normal arrow , and the shadow that turns into the answer.

Recall Feynman retelling — say it back in plain words
A line has a built-in arrow that points straight across it, called the normal, and its two numbers are exactly the and in the line's equation; the length of that arrow is . To find how far my point is from the line, I stand on the line anywhere, draw an arrow up to , and ask "how much of this arrow points across, in the normal's direction?" — that's a dot product. When I compute it, the spot where I chose to stand cancels out (because it's on the line, so ), leaving just . I divide by the normal's length to turn "how much overlap" into a true length, and I slap absolute-value bars on because a distance can never be negative. Done: .
Question :: Where does the in the denominator come from?
Question :: Why does the arbitrary on-line point disappear from the final formula?
Question :: Why the absolute value bars?
Question
Question
Question
Connections: Distance from a point to a line · Normal Vector to a Line · Projection of Vectors · Perpendicular Lines · Distance Formula · Equation of a Line · Linear Programming