Straight Lines • Topic 3 of 3

Distance of a Point from a Line

Every straight line can be written as a single linear equation, the general form:

$$Ax+By+C=0,\quad (A,B)\ne(0,0)$$

This is the great unifier — it handles vertical lines (where $B = 0$) just as easily as any other. Reducing the general form to the other forms is a routine skill: rearranging to $y = -\dfrac{A}{B}x - \dfrac{C}{B}$ shows the slope is $-\dfrac{A}{B}$ and the $y$-intercept $-\dfrac{C}{B}$ (when $B \ne 0$); dividing $Ax + By = -C$ by $-C$ gives the intercept form $\dfrac{x}{(-C/A)} + \dfrac{y}{(-C/B)} = 1$; and dividing by $\pm\sqrt{A^2 + B^2}$ (sign chosen to make the constant positive) gives the normal form.

The distance from a point to a line always means the perpendicular distance — the length of the shortest segment from the point to the line. For a line $Ax + By + C = 0$ and a point $(x_1, y_1)$, this shortest distance is:

$$d=\dfrac{|Ax_1+By_1+C|}{\sqrt{A^2+B^2}}$$

The recipe is mechanical: substitute the point's coordinates into the left-hand side, take the absolute value (distance is never negative), and divide by $\sqrt{A^2 + B^2}$. The line must be in $Ax + By + C = 0$ form before you read off $A$, $B$, $C$. From the origin this collapses to $d = \dfrac{|C|}{\sqrt{A^2+B^2}}$.

Distance between two parallel lines. Parallel lines never meet, so the gap between them is constant. Written with identical coefficients of $x$ and $y$ as $Ax+By+C_1=0$ and $Ax+By+C_2=0$, the perpendicular distance between them is:

$$d=\dfrac{|C_1-C_2|}{\sqrt{A^2+B^2}}$$

The crucial precondition: the $x$- and $y$-coefficients must be made identical before subtracting the constants.

SituationFormulaWatch out for
Point $(x_1, y_1)$ to line$d = \dfrac{|Ax_1 + By_1 + C|}{\sqrt{A^2 + B^2}}$line must be $Ax + By + C = 0$
Origin to line$d = \dfrac{|C|}{\sqrt{A^2 + B^2}}$just set $x_1 = y_1 = 0$
Two parallel lines$d = \dfrac{|C_1 - C_2|}{\sqrt{A^2 + B^2}}$make $A, B$ identical first

Family of lines. When two lines $L_1: A_1x + B_1y + C_1 = 0$ and $L_2: A_2x + B_2y + C_2 = 0$ intersect, every line through their point of intersection can be written, for some real parameter $\lambda$, as:

$$(A_1x + B_1y + C_1) + \lambda\,(A_2x + B_2y + C_2) = 0$$

This is enormously useful: instead of first solving for the intersection point and then forming the line, you impose one extra condition (passes through a point, has a given slope, is perpendicular to something) and solve for $\lambda$. The single equation already "knows" it passes through the common point for every value of $\lambda$.

Shifting of origin. Sometimes an equation simplifies if we move the origin to a new point $(h, k)$ without rotating the axes. The old coordinates $(x, y)$ and new coordinates $(X, Y)$ are linked by:

$$x = X + h,\qquad y = Y + k$$

Substituting these into a curve's equation re-expresses it relative to the new origin — a translation that can clear away constant terms and reveal the structure of the equation.

Deeper Insight — why the sign tells you which side: The absolute value in the distance formula hides a useful secret. Before you take the modulus, the signed quantity $\dfrac{Ax_1 + By_1 + C}{\sqrt{A^2 + B^2}}$ tells you not only how far the point is from the line but on which side of it the point lies — points on opposite sides give opposite signs, while points on the line give exactly zero. This is the foundation of how a line splits the plane into two half-planes, an idea you rely on heavily in Linear Programming when shading feasible regions. The denominator $\sqrt{A^2 + B^2}$ is no accident: it is the length of the normal vector $(A, B)$, and dividing by it converts the raw value into a true geometric distance. The parallel-line formula is the same idea applied twice — both lines share the same normal direction, so their separation is just the difference in their constants, scaled by that length. Even the family-of-lines trick and shifting the origin are about choosing a smarter description of the same geometry: all the formulas of this topic are really one idea wearing different hats.

Perpendicular distance from a point to a line Perpendicular Distance from a Point Ax + By + C = 0 (x₁, y₁) d Constant distance between two parallel lines Distance Between Parallel Lines Ax+By+C₁=0 Ax+By+C₂=0 d
1
Worked Example
Find the distance of the point $(3, -5)$ from the line $4x - 3y - 26 = 0$.
Solution
  1. Here $A = 4$, $B = -3$, $C = -26$, and $(x_1, y_1) = (3, -5)$.
  2. Numerator: $|4(3) - 3(-5) - 26| = |12 + 15 - 26| = |1| = 1$.
  3. Denominator: $\sqrt{4^2 + (-3)^2} = \sqrt{16 + 9} = \sqrt{25} = 5$.
  4. $d = \dfrac{1}{5}$.

Answer: $d = \dfrac{1}{5}$ units.

2
Worked Example
Find the perpendicular distance from the origin to the line $3x + 4y - 10 = 0$.
Solution
  1. For the origin, use $d = \dfrac{|C|}{\sqrt{A^2 + B^2}}$ with $C = -10$.
  2. Denominator: $\sqrt{3^2 + 4^2} = \sqrt{25} = 5$.
  3. $d = \dfrac{|-10|}{5} = \dfrac{10}{5} = 2$.

Answer: $d = 2$ units.

3
Worked Example
Find the distance between the parallel lines $3x + 4y + 5 = 0$ and $3x + 4y - 15 = 0$.
Solution
  1. The coefficients of $x$ and $y$ already match, so $A = 3$, $B = 4$, $C_1 = 5$, $C_2 = -15$.
  2. Use $d = \dfrac{|C_1 - C_2|}{\sqrt{A^2 + B^2}} = \dfrac{|5 - (-15)|}{\sqrt{9 + 16}}$.
  3. $d = \dfrac{20}{5} = 4$.

Answer: $d = 4$ units.

4
Worked Example
Find the distance between the lines $2x + 3y = 4$ and $4x + 6y = 7$.
Solution
  1. Make the coefficients identical. Multiply the first by $2$: $4x + 6y = 8$, i.e. $4x + 6y - 8 = 0$.
  2. The second is $4x + 6y - 7 = 0$. Now $A = 4$, $B = 6$, $C_1 = -8$, $C_2 = -7$.
  3. $d = \dfrac{|C_1 - C_2|}{\sqrt{A^2 + B^2}} = \dfrac{|-8 - (-7)|}{\sqrt{16 + 36}} = \dfrac{1}{\sqrt{52}} = \dfrac{1}{2\sqrt{13}}$.

Answer: $d = \dfrac{1}{2\sqrt{13}}$ units.

5
Worked Example
Find the value of $p$ if the distance of the point $(1, 2)$ from the line $3x + 4y - p = 0$ is $4$ units.
Solution
  1. Distance: $\dfrac{|3(1) + 4(2) - p|}{\sqrt{3^2 + 4^2}} = \dfrac{|11 - p|}{5} = 4$.
  2. So $|11 - p| = 20$, giving $11 - p = 20$ or $11 - p = -20$.
  3. Solve: $p = -9$ or $p = 31$.

Answer: $p = -9$ or $p = 31$.

6
Worked Example
Find the length of the perpendicular from $(-2, 3)$ to the line $5x - 12y + 13 = 0$.
Solution
  1. Here $A = 5$, $B = -12$, $C = 13$, and $(x_1, y_1) = (-2, 3)$.
  2. Numerator: $|5(-2) - 12(3) + 13| = |-10 - 36 + 13| = |-33| = 33$.
  3. Denominator: $\sqrt{5^2 + (-12)^2} = \sqrt{25 + 144} = \sqrt{169} = 13$.
  4. $d = \dfrac{33}{13}$.

Answer: $d = \dfrac{33}{13}$ units.

7
Worked Example
Reduce the line $\sqrt{3}\,x + y - 8 = 0$ to (a) slope-intercept form, (b) intercept form, and (c) normal form.
Solution
  1. (a) Slope-intercept: $y = -\sqrt{3}\,x + 8$, so $m = -\sqrt{3}$ and $c = 8$.
  2. (b) Intercept: $\sqrt{3}\,x + y = 8 \Rightarrow \dfrac{x}{8/\sqrt{3}} + \dfrac{y}{8} = 1$, so $a = \dfrac{8}{\sqrt{3}}$, $b = 8$.
  3. (c) Normal: $\sqrt{A^2 + B^2} = \sqrt{3 + 1} = 2$; divide $\sqrt{3}\,x + y = 8$ by $2$: $\dfrac{\sqrt{3}}{2}x + \dfrac{1}{2}y = 4$, i.e. $x\cos 30^\circ + y\sin 30^\circ = 4$.

Answer: (a) $y = -\sqrt{3}\,x + 8$; (b) $\dfrac{x}{8/\sqrt{3}} + \dfrac{y}{8} = 1$; (c) $x\cos 30^\circ + y\sin 30^\circ = 4$, with $p = 4$.

8
Worked Example
Find the equations of the lines parallel to $3x - 4y + 7 = 0$ and at a distance of $3$ units from it.
Solution
  1. A parallel line has the same $x, y$ coefficients: $3x - 4y + k = 0$.
  2. Distance between them: $\dfrac{|k - 7|}{\sqrt{3^2 + (-4)^2}} = \dfrac{|k - 7|}{5} = 3$.
  3. So $|k - 7| = 15 \Rightarrow k = 22$ or $k = -8$.

Answer: $3x - 4y + 22 = 0$ and $3x - 4y - 8 = 0$.

9
Worked Example
Find the equation of the line passing through the point of intersection of $x + 2y - 3 = 0$ and $2x - y + 1 = 0$, and through the point $(2, 3)$, using the family-of-lines method.
Solution
  1. Family: $(x + 2y - 3) + \lambda(2x - y + 1) = 0$.
  2. It must pass through $(2, 3)$: $(2 + 6 - 3) + \lambda(4 - 3 + 1) = 0 \Rightarrow 5 + 2\lambda = 0 \Rightarrow \lambda = -\dfrac{5}{2}$.
  3. Substitute: $(x + 2y - 3) - \dfrac{5}{2}(2x - y + 1) = 0$. Multiply by $2$: $2x + 4y - 6 - 5(2x - y + 1) = 0 \Rightarrow 2x + 4y - 6 - 10x + 5y - 5 = 0$.
  4. Simplify: $-8x + 9y - 11 = 0$, i.e. $8x - 9y + 11 = 0$.

Answer: $8x - 9y + 11 = 0$.

10
Worked Example
Find the distance between the parallel lines $3x - 4y + 7 = 0$ and $3x - 4y + 2 = 0$ by taking a convenient point on one of them.
Solution
  1. Find a point on the second line $3x - 4y + 2 = 0$: put $y = 0 \Rightarrow x = -\dfrac{2}{3}$, giving $\left(-\dfrac{2}{3}, 0\right)$.
  2. Distance from this point to the first line: $\dfrac{|3(-\tfrac{2}{3}) - 4(0) + 7|}{\sqrt{3^2 + (-4)^2}} = \dfrac{|-2 + 7|}{5} = \dfrac{5}{5} = 1$.
  3. (Check with the parallel-line formula: $\dfrac{|7 - 2|}{5} = 1$.)

Answer: $d = 1$ unit.

11
Worked Example
Find the new equation of the line $2x + 3y - 5 = 0$ when the origin is shifted to the point $(1, 1)$, the axes remaining parallel.
Solution
  1. Shifting origin to $(1, 1)$: substitute $x = X + 1$, $y = Y + 1$.
  2. $2(X + 1) + 3(Y + 1) - 5 = 0 \Rightarrow 2X + 2 + 3Y + 3 - 5 = 0$.
  3. Simplify: $2X + 3Y = 0$.

Answer: The transformed equation is $2X + 3Y = 0$ (it now passes through the new origin).

12
Worked Example
If $p$ is the length of the perpendicular from the origin to the line $\dfrac{x}{a} + \dfrac{y}{b} = 1$, show that $\dfrac{1}{p^2} = \dfrac{1}{a^2} + \dfrac{1}{b^2}$.
Solution
  1. Write the line in general form: $\dfrac{x}{a} + \dfrac{y}{b} - 1 = 0$, i.e. $bx + ay - ab = 0$ (multiplying by $ab$).
  2. Distance from the origin: $p = \dfrac{|{-ab}|}{\sqrt{b^2 + a^2}} = \dfrac{ab}{\sqrt{a^2 + b^2}}$.
  3. Square and invert: $p^2 = \dfrac{a^2 b^2}{a^2 + b^2} \Rightarrow \dfrac{1}{p^2} = \dfrac{a^2 + b^2}{a^2 b^2} = \dfrac{1}{b^2} + \dfrac{1}{a^2}$.

Answer: $\dfrac{1}{p^2} = \dfrac{1}{a^2} + \dfrac{1}{b^2}$, as required.

Key Points

  • Every line is $Ax + By + C = 0$; from it slope $= -\dfrac{A}{B}$, $x$-intercept $= -\dfrac{C}{A}$, $y$-intercept $= -\dfrac{C}{B}$ (when defined).
  • The general form reduces to slope-intercept, intercept and normal forms by simple rearrangement (divide by $\pm\sqrt{A^2+B^2}$ for normal form).
  • Distance from a point to a line is the perpendicular distance: $d = \dfrac{|Ax_1 + By_1 + C|}{\sqrt{A^2 + B^2}}$ — put the line in $Ax + By + C = 0$ form first.
  • From the origin this simplifies to $d = \dfrac{|C|}{\sqrt{A^2 + B^2}}$.
  • Parallel lines: $d = \dfrac{|C_1 - C_2|}{\sqrt{A^2 + B^2}}$ — make the $x, y$ coefficients identical before subtracting.
  • Family of lines through the intersection of $L_1, L_2$: $L_1 + \lambda L_2 = 0$ — impose one extra condition to find $\lambda$.
  • Shifting the origin to $(h, k)$: substitute $x = X + h$, $y = Y + k$ to re-express an equation about the new origin.
  • The sign of $Ax_1 + By_1 + C$ (before the modulus) reveals which side of the line the point lies on.
Tap an option to check your answer0 / 4
Q1.The distance from $(x_1,y_1)$ to $ax+by+c=0$ is:
Explanation: Standard perpendicular-distance formula.
Q2.The distance from the origin to $3x+4y=10$ is:
Explanation: $\tfrac{10}{5}=2$.
Q3.The distance between parallel lines $ax+by+c_1=0$ and $ax+by+c_2=0$ is:
Explanation: Use the distance formula with the same point.
Q4.The distance from $(1,1)$ to $x+y=0$ is:
Explanation: $\tfrac{|2|}{\sqrt2}=\sqrt2$.