Skip to content

Mathematics · Ch 6 — Two Dimensional Analytical Geometry

Distance Formulas

6.4.4

Distance Formulas

Three distance formulas are developed:

  1. Distance between two points (x1,y1),(x2,y2)(x_1,y_1),(x_2,y_2):

    D=(x2−x1)2+(y2−y1)2D=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}

    (the ordinary Pythagorean distance, already familiar from earlier classes).
  2. Distance from a point to a line. For P(x1,y1)P(x_1,y_1) and the line AB ⁣:ax+by+c=0AB\colon ax+by+c=0: draw CDCD through PP parallel to ABAB, drop the perpendicular from PP to ABAB meeting it at MM, and drop the perpendicular from the origin to ABAB meeting it at RR and meeting CDCD at QQ. If ABAB's normal form is xcos⁡α+ysin⁡α=px\cos\alpha+y\sin\alpha=p (with cos⁡α=±a/a2+b2\cos\alpha=\pm a/\sqrt{a^2+b^2}, sin⁡α=±b/a2+b2\sin\alpha=\pm b/\sqrt{a^2+b^2}, p=∓c/a2+b2p=\mp c/\sqrt{a^2+b^2}, from comparing coefficients as in §6.3.4), then CDCD's normal form is xcos⁡α+ysin⁡α=p′x\cos\alpha+y\sin\alpha=p' where p′=x1cos⁡α+y1sin⁡αp'=x_1\cos\alpha+y_1\sin\alpha (since CDCD passes through PP). The required distance is PM=QR=OR−OQ=p−p′PM=QR=OR-OQ=p-p', which simplifies to

    D=∣ax1+by1+ca2+b2∣.D=\left|\frac{ax_1+by_1+c}{\sqrt{a^2+b^2}}\right|.

  3. Distance between two parallel lines a1x+b1y+c1=0a_1x+b_1y+c_1=0 and a1x+b1y+c2=0a_1x+b_1y+c_2=0 (same a1,b1a_1,b_1):

    D=∣c2−c1∣a12+b12D=\frac{|c_2-c_1|}{\sqrt{a_1^2+b_1^2}}

    — proved from (ii) by taking the point (x1,y1)(x_1,y_1) on one of the lines to be the origin (or any convenient point on it). Foot of the perpendicular and the image of a point. The coordinates of the foot of the perpendicular dropped from (x1,y1)(x_1,y_1) to ax+by+c=0ax+by+c=0 satisfy the parametric relation (a direct application of §6.3.3's parametric form, moving a signed distance along the direction perpendicular to the line)

    x−x1a=y−y1b=−(ax1+by1+c)a2+b2,\frac{x-x_1}{a}=\frac{y-y_1}{b}=\frac{-(ax_1+by_1+c)}{a^2+b^2},

    and the image (mirror reflection) of (x1,y1)(x_1,y_1) in the same line — twice as far along the same perpendicular direction, since the foot is the midpoint of a point and its image — satisfies x−x1a=y−y1b=−2(ax1+by1+c)a2+b2.\frac{x-x_1}{a}=\frac{y-y_1}{b}=\frac{-2(ax_1+by_1+c)}{a^2+b^2}. …
Figure 6.37Point-to-line distance construction

What this figure shows. The given line ABAB with a parallel line CDCD through P(x1,y1)P(x_1,y_1); the perpendiculars from PP and from the origin meet ABAB at MM and RR and CDCD at QQ, so the required distance PMPM equals OR−OQ=p−p′OR-OQ=p-p'. …