Lesson 17 of 42 · Geometry and trigonometry

Points, distances and lines in the plane

Find distances, midpoints and slopes, write the equation of a line, and spot parallel and perpendicular lines and where two lines meet.

About 22 minutes

In this lesson

  • Compute the distance and the midpoint between two points, and the distance from a point to a line.
  • Find the slope of a line from two points or from an equation in the form ax+by+c=0ax + by + c = 0.
  • Write the equation of a line through a point, parallel or perpendicular to a given line.
  • Find the intersection of two lines by solving a system.

The idea

Points and distance

A point in the plane is a pair (x,y)(x, y). The distance between A(x1,y1)A(x_1, y_1) and B(x2,y2)B(x_2, y_2) is the hypotenuse of a right triangle whose legs are the horizontal gap x2−x1x_2 - x_1 and the vertical gap y2−y1y_2 - y_1:

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

Because each gap is squared, the order of the points does not matter and negative gaps cause no harm. The midpoint of ABAB averages the coordinates:

M=(x1+x22,y1+y22)M = \left(\frac{x_1 + x_2}{2}, \frac{y_1 + y_2}{2}\right)

Distance subtracts; midpoint adds. Mixing the two is the commonest slip in this topic.

Slope

The slope of the line through AA and BB is the vertical change per unit of horizontal change:

m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}

Subtract in the same order on top and bottom. A positive slope rises from left to right, a negative slope falls, a slope of 0 is a horizontal line, and a vertical line (where x2=x1x_2 = x_1) has no slope at all. The slope is also the tangent of the angle the line makes with the positive xx-axis, which links this lesson to trigonometry: a slope of 1 means a 45° line.

Equations of a line

Every non-vertical line can be written as y=mx+qy = mx + q, where mm is the slope and qq the yy-intercept, the height at which it crosses the yy-axis. Two other forms are just as useful:

  • Point and slope. The line through (x0,y0)(x_0, y_0) with slope mm is y−y0=m(x−x0)y - y_0 = m(x - x_0). This is the fastest way to write a line when a question gives a point and a direction.
  • General form. ax+by+c=0ax + by + c = 0 covers every line, vertical ones included. If b≠0b \neq 0, solving for yy gives y=−abx−cby = -\frac{a}{b}x - \frac{c}{b}, so the slope is −ab-\frac{a}{b}.

Vertical lines are x=hx = h; horizontal lines are y=ky = k. A point lies on a line exactly when its coordinates satisfy the equation, which is also the quickest way to test an answer option.

Parallel and perpendicular

Two non-vertical lines are parallel when their slopes are equal, m1=m2m_1 = m_2. They are perpendicular when the product of their slopes is −1-1, that is m2=−1m1m_2 = -\frac{1}{m_1}: flip the fraction and change its sign. A line of slope 23\frac{2}{3} is perpendicular to every line of slope −32-\frac{3}{2}. The special case: a horizontal line is perpendicular to a vertical one, though neither formula covers it.

In general form there is a shortcut. The lines parallel to ax+by+c=0ax + by + c = 0 are ax+by+k=0ax + by + k = 0 for any kk: keep aa and bb, change the constant. The lines perpendicular to it are bx−ay+k=0bx - ay + k = 0: swap aa and bb and change one sign. Then fix kk by substituting the given point.

Where two lines meet

The intersection point satisfies both equations, so solve them as a system, by substitution or by elimination. The system has exactly one solution when the slopes differ, none when the lines are parallel and distinct, and infinitely many when the two equations describe the same line (one is a multiple of the other).

Distance from a point to a line

The shortest distance from P(x0,y0)P(x_0, y_0) to the line ax+by+c=0ax + by + c = 0 is measured along the perpendicular:

d=∣ax0+by0+c∣a2+b2d = \frac{\lvert ax_0 + by_0 + c \rvert}{\sqrt{a^2 + b^2}}

The line must be in general form, with everything on one side, before you read off aa, bb and cc. This formula returns in the lesson on lines and conics, where comparing a distance with a radius decides whether a line cuts a circle.

Working without a calculator

Coordinates in these questions are chosen to give tidy numbers: gaps of 6 and 8 give a distance of 10, a denominator of 32+42=5\sqrt{3^2 + 4^2} = 5 divides cleanly. If your working produces an ugly root, recheck a subtraction before you trust it.

Worked examples

Example 1: Distance, midpoint, slope and equation

For A(−1,2)A(-1, 2) and B(5,10)B(5, 10), find ABAB, the midpoint of ABAB, the slope of line ABAB and its equation.

  1. Gaps: 5−(−1)=65 - (-1) = 6 horizontally and 10−2=810 - 2 = 8 vertically.

  2. Distance: 62+82=100=10\sqrt{6^2 + 8^2} = \sqrt{100} = 10.

  3. Midpoint: (−1+52,2+102)=(2,6)\left(\frac{-1 + 5}{2}, \frac{2 + 10}{2}\right) = (2, 6).

  4. Slope: 86=43\frac{8}{6} = \frac{4}{3}.

  5. Point and slope through AA: y−2=43(x+1)y - 2 = \frac{4}{3}(x + 1). Multiply by 3: 3y−6=4x+43y - 6 = 4x + 4, so 4x−3y+10=04x - 3y + 10 = 0. Check with BB: 20−30+10=020 - 30 + 10 = 0.

Answer

AB=10AB = 10, midpoint (2,6)(2, 6), slope 43\frac{4}{3}, line 4x−3y+10=04x - 3y + 10 = 0. Writing the slope as 68\frac{6}{8}, run over rise, is the tempting inversion.

Example 2: A perpendicular through a given point

Find the line through P(2,−1)P(2, -1) perpendicular to 3x−4y+7=03x - 4y + 7 = 0.

  1. Slope of the given line: −ab=−3−4=34-\frac{a}{b} = -\frac{3}{-4} = \frac{3}{4}.

  2. Perpendicular slope: flip and change sign, −43-\frac{4}{3}.

  3. Point and slope: y+1=−43(x−2)y + 1 = -\frac{4}{3}(x - 2). Multiply by 3: 3y+3=−4x+83y + 3 = -4x + 8, so 4x+3y−5=04x + 3y - 5 = 0.

  4. Check with the shortcut: swapping aa and bb and changing one sign gives 4x+3y+k=04x + 3y + k = 0, and PP gives 8−3+k=08 - 3 + k = 0, so k=−5k = -5. The same line.

Answer

The line is 4x+3y−5=04x + 3y - 5 = 0. Taking only the negative (−34-\frac{3}{4}) or only the reciprocal (43\frac{4}{3}) gives a line that is not perpendicular.

Example 3: Where two lines cross

Find the intersection of 2x+y=72x + y = 7 and x−3y=7x - 3y = 7.

  1. The slopes are −2-2 and 13\frac{1}{3}, which differ, so there is exactly one intersection. (Their product is −23-\frac{2}{3}, so the lines are not perpendicular.)

  2. From the first equation, y=7−2xy = 7 - 2x. Substitute into the second: x−3(7−2x)=7x - 3(7 - 2x) = 7, so 7x−21=77x - 21 = 7 and x=4x = 4.

  3. Then y=7−8=−1y = 7 - 8 = -1.

  4. Check in both: 8−1=78 - 1 = 7 and 4+3=74 + 3 = 7.

Answer

The lines meet at (4,−1)(4, -1).

Example 4: Distance from a point to a line

Find the distance from P(1,2)P(1, 2) to the line 3x+4y=213x + 4y = 21.

  1. Put the line in general form first: 3x+4y−21=03x + 4y - 21 = 0, so a=3a = 3, b=4b = 4, c=−21c = -21.

  2. Numerator: ∣3+8−21∣=∣−10∣=10\lvert 3 + 8 - 21 \rvert = \lvert -10 \rvert = 10. Denominator: 9+16=5\sqrt{9 + 16} = 5.

  3. Distance: 105=2\frac{10}{5} = 2.

  4. Second route: the perpendicular from PP runs in the direction (3,4)(3, 4). The point (1+3t,2+4t)(1 + 3t, 2 + 4t) is on the line when 25t+11=2125t + 11 = 21, so t=0.4t = 0.4, giving the foot (2.2,3.6)(2.2, 3.6). Its distance from PP is 0.4⋅32+42=20.4 \cdot \sqrt{3^2 + 4^2} = 2.

Answer

The distance is 22. Using c=+21c = +21, from the equation before it was rearranged, gives 325\frac{32}{5}, which is wrong.

Common traps

  • Half a perpendicular

    The perpendicular slope needs both moves: reciprocal and sign change. From slope 33, the perpendicular slope is −13-\frac{1}{3}; −3-3 is the slope of a line with the opposite tilt, and 13\frac{1}{3} is a line of similar tilt. Check by multiplying: the product must be −1-1.

  • Reading the slope off the general form

    In ax+by+c=0ax + by + c = 0 the slope is −ab-\frac{a}{b}, not aa, not ba\frac{b}{a}. For 2x−5y+4=02x - 5y + 4 = 0 it is 25\frac{2}{5}. If in doubt, solve for yy.

  • Mismatched order in the slope

    Writing y2−y1x1−x2\frac{y_2 - y_1}{x_1 - x_2} flips the sign of the slope. Subtract the coordinates of the same point first, top and bottom.

  • Distance formula on an unrearranged equation

    The point-to-line formula needs everything on one side equal to zero. With 3x+4y=213x + 4y = 21 the constant is −21-21, not 2121.

Check yourself

Answer each question before you open its answer.

Question 1: Distance between two points

Points and distances

What is the distance between P(−2,5)P(-2, 5) and Q(4,−3)Q(4, -3)?

  1. A.222\sqrt{2}
  2. B.1010
  3. C.1414
  4. D.100100
Show the answer

Answer: B. 1010

Working

The gaps are 4−(−2)=64 - (-2) = 6 and −3−5=−8-3 - 5 = -8. Distance: 36+64=100=10\sqrt{36 + 64} = \sqrt{100} = 10.

Why the other options are wrong

  • A. This adds the coordinates instead of subtracting them, giving gaps of 2 and 2. That is the route to the midpoint, not to the distance.
  • C. This adds the two gaps, 6+86 + 8. A straight line is shorter than going across and then up: the gaps are legs of a right triangle.
  • D. This is the sum of the squared gaps, the distance squared; the square root was left out.

What carries over

Distance squares the gaps, adds them and takes the root; the sign of each gap does not matter.

Question 2: A parallel through a point

Lines

Which line passes through (1,3)(1, 3) and is parallel to 2x−5y+4=02x - 5y + 4 = 0?

  1. A.5x+2y−11=05x + 2y - 11 = 0
  2. B.5x−2y+1=05x - 2y + 1 = 0
  3. C.2x−5y+4=02x - 5y + 4 = 0
  4. D.2x−5y+13=02x - 5y + 13 = 0
Show the answer

Answer: D. 2x−5y+13=02x - 5y + 13 = 0

Working

Parallel lines keep aa and bb: 2x−5y+k=02x - 5y + k = 0. Through (1,3)(1, 3): 2−15+k=02 - 15 + k = 0, so k=13k = 13. Check by slopes: the given line has slope −2−5=25-\frac{2}{-5} = \frac{2}{5}, and so does the answer.

Why the other options are wrong

  • A. This line has slope −52-\frac{5}{2}, so it is perpendicular to the given line, not parallel.
  • B. This line has slope 52\frac{5}{2}, the reciprocal of the right slope; it comes from reading the slope of the given line as ba\frac{b}{a} with a sign slip.
  • C. This is the given line itself. It does not pass through (1,3)(1, 3): 2−15+4=−92 - 15 + 4 = -9, not 0.

What carries over

For a parallel line, keep the coefficients of x and y and choose the constant that fits the point.

Question 3: Making two lines perpendicular

Lines

For which value of kk is the line kx+2y−1=0kx + 2y - 1 = 0 perpendicular to the line 3x−y+5=03x - y + 5 = 0?

  1. A.−6-6
  2. B.−23-\frac{2}{3}
  3. C.23\frac{2}{3}
  4. D.66
Show the answer

Answer: C. 23\frac{2}{3}

Working

The second line is y=3x+5y = 3x + 5, slope 3. The first has slope −k2-\frac{k}{2}. Perpendicular means 3⋅(−k2)=−13 \cdot \left(-\frac{k}{2}\right) = -1, so k=23k = \frac{2}{3}. Check: the first slope is then −13-\frac{1}{3}, and 3⋅(−13)=−13 \cdot \left(-\frac{1}{3}\right) = -1.

Why the other options are wrong

  • A. With k=−6k = -6 the first line has slope 3, equal to the second: the lines are parallel, not perpendicular.
  • B. This gives slope 13\frac{1}{3}, the reciprocal of 3 without the sign change; the product of slopes is +1+1.
  • D. This gives slope −3-3, the negative of 3 without the reciprocal; the product of slopes is −9-9.

What carries over

Perpendicular slopes multiply to minus one: reciprocal and sign change together.

Key points

  • Distance (x2−x1)2+(y2−y1)2\sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} subtracts; the midpoint averages.

  • The slope of ax+by+c=0ax + by + c = 0 is −ab-\frac{a}{b}.

  • Parallel: equal slopes. Perpendicular: slopes multiply to −1-1.

  • Point to line: ∣ax0+by0+c∣a2+b2\frac{\lvert ax_0 + by_0 + c \rvert}{\sqrt{a^2 + b^2}}, with the line written as ax+by+c=0ax + by + c = 0 first.

All questions here are original and written for UniExamer; none comes from the test maker.

Written by the UniExamer team with AI assistance. Every worked example and check question was re-solved by an independent checker before publication. No subject expert has reviewed this lesson yet. If you find a mistake, write to support@uniexamer.com.

Practica este tema

Preguntas nuevas sobre esta habilidad, con explicaciones resueltas. La práctica requiere un Single Exam Pass o Plus.