Analytic (Coordinate) Geometry

the distance from a point to a line

How far is a point from a line? There are infinitely many ways to walk from a point to a line, but only the shortest one counts as 'the distance', and that shortest path is always the perpendicular dropped straight onto the line. Think of the shortest leash from a dog to a long straight fence: it runs at a right angle to the fence.

If the line is written in general form A x + B y + C = 0 and the point is P_0 = (x_0, y_0), the perpendicular distance is d = |A x_0 + B y_0 + C| / sqrt(A^2 + B^2). The recipe in plain steps: take the point's coordinates, plug them into the left-hand side A x + B y + C (which is zero for points on the line and nonzero off it), take the absolute value (distance is never negative), then divide by sqrt(A^2 + B^2) to scale correctly. For example, the distance from (4, 3) to the line 3x + 4y - 5 = 0 is |3*4 + 4*3 - 5| / sqrt(9 + 16) = |19| / 5 = 19/5 = 3.8.

This formula is the engine behind a host of facts: the radius needed for a circle to just touch a line (tangency), the width of the strip between two parallel lines, and the altitude of a triangle once its sides are equations. The absolute value matters: it discards which side of the line the point is on, keeping only the size of the gap. If you want to know the side as well, the sign of A x_0 + B y_0 + C before taking absolute value tells you which half-plane the point lies in.

Does the line 3x + 4y - 5 = 0 cross, touch, or miss the circle centered at (4, 3) with radius 2? The center-to-line distance is 19/5 = 3.8, which is greater than the radius 2, so the line misses the circle entirely — no intersection.

Compare center-to-line distance with the radius: greater means miss, equal means tangent, smaller means two crossings.

Put the line in general form A x + B y + C = 0 before using the formula, and divide by sqrt(A^2 + B^2), not by A + B. The numerator's absolute value is essential — without it you can get a meaningless negative 'distance'.

Also called
perpendicular distancepoint-line distance formula點線距離垂直距離