Skip to content

Mathematics · Ch 9 — Straight Lines

Distance of a Point From a Line

9.4

Distance of a Point From a Line

The Distance of a Point from a Line

The distance of a point from a line is defined as the length of the perpendicular drawn from the point to the line. This is the shortest possible distance between the point and any point on the line.

Consider a line LL given by the general equation Ax+By+C=0Ax + By + C = 0, and a point P(x1,y1)P(x_1, y_1) whose perpendicular distance dd from LL we want to find. Drop a perpendicular from PP to LL, meeting LL at point MM. The length PMPM is the required distance dd.

Note

The perpendicular distance is always taken as a positive quantity. If the point lies on the line itself, the distance is zero.


Derivation of the Distance Formula

The textbook derives the formula using the area of a triangle. Here is the complete reasoning, step by step.

Let the line L:Ax+By+C=0L: Ax + By + C = 0 intersect the xx-axis at QQ and the yy-axis at RR.

Step 1: Find the coordinates of QQ and RR.

On the xx-axis, y=0y = 0. Substituting into Ax+By+C=0Ax + By + C = 0 gives Ax+C=0Ax + C = 0, so x=−CAx = -\frac{C}{A}. Hence Q=(−CA,0)Q = \left(-\frac{C}{A}, 0\right).

On the yy-axis, x=0x = 0. Substituting gives By+C=0By + C = 0, so y=−CBy = -\frac{C}{B}. Hence R=(0,−CB)R = \left(0, -\frac{C}{B}\right).

Step 2: Express the area of triangle PQRPQR in two ways.

The area of △PQR\triangle PQR can be written as 12×base×height\frac{1}{2} \times \text{base} \times \text{height}. If we take QRQR as the base, then the perpendicular from PP to QRQR is PMPM, which is exactly the distance dd we want. So

Area(△PQR)=12×QR×PM\text{Area}(\triangle PQR) = \frac{1}{2} \times QR \times PM

From this,

PM=2×Area(△PQR)QR(1)PM = \frac{2 \times \text{Area}(\triangle PQR)}{QR} \qquad(1)

Step 3: Compute Area(△PQR)\text{Area}(\triangle PQR) using the determinant formula.

The area of a triangle with vertices (x1,y1)(x_1, y_1), (x2,y2)(x_2, y_2), (x3,y3)(x_3, y_3) is

12∣x1(y2−y3)+x2(y3−y1)+x3(y1−y2)∣\frac{1}{2} \left| x_1(y_2 - y_3) + x_2(y_3 - y_1) + x_3(y_1 - y_2) \right|

Applying this to P(x1,y1)P(x_1, y_1), Q(−CA,0)Q\left(-\frac{C}{A}, 0\right), R(0,−CB)R\left(0, -\frac{C}{B}\right):

Area(△PQR)=12∣x1(0−(−CB))+(−CA)(−CB−y1)+0(y1−0)∣=12∣x1(CB)−CA(−CB−y1)∣=12∣Cx1B+CA(CB+y1)∣=12∣Cx1B+C2AB+Cy1A∣\begin{aligned} \text{Area}(\triangle PQR) &= \frac{1}{2} \left| x_1\left(0 - \left(-\frac{C}{B}\right)\right) + \left(-\frac{C}{A}\right)\left(-\frac{C}{B} - y_1\right) + 0\left(y_1 - 0\right) \right| \\ &= \frac{1}{2} \left| x_1\left(\frac{C}{B}\right) - \frac{C}{A}\left(-\frac{C}{B} - y_1\right) \right| \\ &= \frac{1}{2} \left| \frac{C x_1}{B} + \frac{C}{A}\left(\frac{C}{B} + y_1\right) \right| \\ &= \frac{1}{2} \left| \frac{C x_1}{B} + \frac{C^2}{AB} + \frac{C y_1}{A} \right| \end{aligned}

Factor out CAB\frac{C}{AB}:

Area(△PQR)=12∣CAB(Ax1+C+By1)∣=∣C∣2∣AB∣∣Ax1+By1+C∣\text{Area}(\triangle PQR) = \frac{1}{2} \left| \frac{C}{AB} \left( A x_1 + C + B y_1 \right) \right| = \frac{|C|}{2|AB|} \left| A x_1 + B y_1 + C \right|

Watch out

The absolute value is crucial — area is always positive. The textbook writes the expression without absolute value signs in the intermediate step, but the final formula uses absolute value for distance.

Step 4: Compute QRQR, the distance between QQ and RR.

QR=(−CA−0)2+(0−(−CB))2=C2A2+C2B2QR = \sqrt{ \left( -\frac{C}{A} - 0 \right)^2 + \left( 0 - \left(-\frac{C}{B}\right) \right)^2 } = \sqrt{ \frac{C^2}{A^2} + \frac{C^2}{B^2} }

Factor out C2C^2:

QR=∣C∣1A2+1B2=∣C∣A2+B2A2B2=∣C∣∣AB∣A2+B2QR = |C| \sqrt{ \frac{1}{A^2} + \frac{1}{B^2} } = |C| \sqrt{ \frac{A^2 + B^2}{A^2 B^2} } = \frac{|C|}{|AB|} \sqrt{A^2 + B^2}

Step 5: Substitute into equation (1).

PM=2×∣C∣2∣AB∣∣Ax1+By1+C∣∣C∣∣AB∣A2+B2=∣C∣∣AB∣∣Ax1+By1+C∣∣C∣∣AB∣A2+B2PM = \frac{2 \times \frac{|C|}{2|AB|} \left| A x_1 + B y_1 + C \right|}{\frac{|C|}{|AB|} \sqrt{A^2 + B^2}} = \frac{ \frac{|C|}{|AB|} \left| A x_1 + B y_1 + C \right| }{ \frac{|C|}{|AB|} \sqrt{A^2 + B^2} }

The factors ∣C∣∣AB∣\frac{|C|}{|AB|} cancel, leaving

PM=∣Ax1+By1+C∣A2+B2PM = \frac{ \left| A x_1 + B y_1 + C \right| }{ \sqrt{A^2 + B^2} }

Since PM=dPM = d, we have the required formula.

d=∣Ax1+By1+C∣A2+B2d = \frac{ |A x_1 + B y_1 + C| }{ \sqrt{A^2 + B^2} }


Understanding the Formula …

Figure 9.14Distance of a point from a line
Fig. 9.14 — Distance of a point from a line

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

The figure shows a single straight line drawn on the standard xyxy-plane. This line, labelled LL, has the equation Ax+By+C=0Ax + By + C = 0. It cuts the xx-axis at point QQ and the yy-axis at point RR. The coordinates of these intercepts are given directly from the line equation: Q(−CA,0)Q\left(-\frac{C}{A}, 0\right) and R(0,−CB)R\left(0, -\frac{C}{B}\right). These two points, together with the origin, form the familiar intercept triangle, but that is not the main triangle in the figure.

A point P(x1,y1)P(x_1, y_1) is plotted somewhere off the line — it could be above or below it, the figure does not specify which side. From PP, a dashed perpendicular segment is drawn down to the line LL, meeting it at point MM. A small right-angle mark is placed at MM to confirm that PMPM is indeed perpendicular to LL. The length of this dashed segment is labelled dd, and this dd is the distance of the point PP from the line LL.

The figure then completes a triangle by drawing two more dashed segments: one from PP to RR and another from PP to QQ. So the dashed triangle is △PQR\triangle PQR, with vertices at the external point PP and the two intercept points QQ and RR on the axes. The side QRQR lies along the line LL itself, and the perpendicular PMPM is the altitude of this triangle from vertex PP to the base QRQR.

The physical idea is simple: the distance from a point to a line is the shortest possible distance, which is always along the perpendicular. The clever trick in the textbook is to avoid directly solving for the foot MM. Instead, they use the area of △PQR\triangle PQR in two different ways. First, area equals 12×base×height=12×QR×PM\frac{1}{2} \times \text{base} \times \text{height} = \frac{1}{2} \times QR \times PM. Second, area can be computed from the coordinates of PP, QQ, and RR using the determinant formula. Equating these two expressions for the same area lets you solve for PMPM without ever finding MM's coordinates.

d=∣Ax1+By1+C∣A2+B2d = \frac{|Ax_1 + By_1 + C|}{\sqrt{A^2 + B^2}}

Here, dd is the perpendicular distance from the point (x1,y1)(x_1, y_1) to the line Ax+By+C=0Ax + By + C = 0. The numerator is the absolute value of the expression obtained by plugging the point's coordinates into the line's left-hand side. The denominator is the square root of the sum of the squares of the coefficients of xx and yy. The absolute value is essential because distance is always non-negative, while Ax1+By1+CAx_1 + By_1 + C could be positive or negative depending on which side of the line the point lies.

Watch out

A common mistake is to forget the absolute value in the numerator. The formula d=Ax1+By1+CA2+B2d = \frac{Ax_1 + By_1 + C}{\sqrt{A^2 + B^2}} without the modulus gives a signed distance — positive on one side of the line, negative on the other. For pure distance, always take the absolute value.

The derivation itself is a neat piece of coordinate geometry. The length QRQR is found using the distance formula between QQ and RR:

QR=(0+CA)2+(−CB−0)2=C2A2+C2B2=∣C∣∣AB∣A2+B2.QR = \sqrt{\left(0 + \frac{C}{A}\right)^2 + \left(-\frac{C}{B} - 0\right)^2} = \sqrt{\frac{C^2}{A^2} + \frac{C^2}{B^2}} = \frac{|C|}{|AB|}\sqrt{A^2 + B^2}.

The area of △PQR\triangle PQR from coordinates is:

Area=12∣x1(0+CB)+(−CA)(−CB−y1)+0(y1−0)∣.\text{Area} = \frac{1}{2}\left| x_1\left(0 + \frac{C}{B}\right) + \left(-\frac{C}{A}\right)\left(-\frac{C}{B} - y_1\right) + 0(y_1 - 0) \right|. …