Straight Lines: Slope, Equation Forms, Angles and Distances

Coordinate geometry describes points by ordered pairs (x, y) and lines by first-degree equations such as ax + by + c = 0. Entry tests ask for distances, midpoints and section points, slopes, equations of lines in various forms, parallel and perpendicular conditions, the angle between two lines and the distance of a point from a line. A small set of formulas, used carefully with signs, answers almost all of them.

Asked in: ECAT, NUST NET, JEE Main, FSc and Class 11-12 boards

Distance, midpoint and section formulas

The distance between two points comes straight from Pythagoras' theorem. The midpoint is the average of the coordinates.

A point P divides the join of A(x₁, y₁) and B(x₂, y₂) in the ratio m : n. If P lies between A and B the division is internal; if it lies on AB extended, it is external and the plus signs become minus signs. The centroid of a triangle is the average of its three vertices.

Slope of a line

The slope (gradient) m of a line is the tangent of the angle θ it makes with the positive x-axis, measured anticlockwise. Through two points it is the rise over the run.

A horizontal line has slope 0 and a vertical line has undefined slope. Parallel lines have equal slopes, and two lines (neither vertical) are perpendicular when the product of their slopes is −1. Three points are collinear when the slope from the first to the second equals the slope from the second to the third.

Forms of the equation of a line

Choose the form that matches the data. Slope and y-intercept: slope-intercept form. A point and the slope: point-slope form. Two points: two-point form. Both intercepts: intercept form. Length p of the perpendicular from the origin and its angle α with the x-axis: normal form.

Every line can be written in the general form ax + by + c = 0. Its slope is −a/b, and it cuts the axes at x = −c/a and y = −c/b.

Parallel and perpendicular lines

A line parallel to ax + by + c = 0 keeps the same x and y coefficients and changes only the constant: ax + by + k = 0. A line perpendicular to it swaps the coefficients and changes one sign: bx − ay + k = 0. Find k by substituting the given point.

Two lines a₁x + b₁y + c₁ = 0 and a₂x + b₂y + c₂ = 0 are perpendicular when a₁a₂ + b₁b₂ = 0, a test that also works when one line is vertical.

Angle between two lines

If two lines have slopes m₁ and m₂, the acute angle θ between them satisfies the formula below. The absolute value gives the acute angle; the obtuse angle is 180° − θ.

If 1 + m₁m₂ = 0 the lines are perpendicular, and if m₁ = m₂ they are parallel.

Distance of a point from a line

The perpendicular distance from (x₁, y₁) to ax + by + c = 0 is found by putting the point into the left side, taking the absolute value and dividing by √(a² + b²). The distance from the origin is |c|/√(a² + b²).

For two parallel lines, first make their x and y coefficients identical, then divide the difference of the constants by √(a² + b²).

Intersection and concurrency

Solve the two equations together to find where two lines meet. Any line through the point of intersection of L₁ = 0 and L₂ = 0 can be written L₁ + kL₂ = 0, which avoids finding the point at all.

Three lines are concurrent (pass through one point) when the determinant of their coefficients is zero, provided no two of them are parallel.

Solved examples

  1. Find the distance between A(−2, 3) and B(4, −5), and the midpoint of AB.
    1. Differences: x₂ − x₁ = 4 − (−2) = 6 and y₂ − y₁ = −5 − 3 = −8.
    2. AB = √(36 + 64) = √100 = 10.
    3. Midpoint = ((−2 + 4)/2, (3 − 5)/2) = (1, −1).
    Answer: AB = 10; midpoint (1, −1)
  2. Find the points that divide the join of A(1, −2) and B(7, 4) in the ratio 2 : 1 (a) internally and (b) externally.
    1. (a) Internal: x = (2 × 7 + 1 × 1)/3 = 15/3 = 5 and y = (2 × 4 + 1 × (−2))/3 = 6/3 = 2.
    2. (b) External: x = (2 × 7 − 1 × 1)/(2 − 1) = 13 and y = (2 × 4 − 1 × (−2))/1 = 10.
    3. Check (b): B is the midpoint of A(1, −2) and (13, 10), since (1 + 13)/2 = 7 and (−2 + 10)/2 = 4. So the point is twice as far from A as from B, as required.
    Answer: (a) (5, 2); (b) (13, 10)
  3. Find the equation of the line through (2, −1) and (5, 5), and its intercepts on the axes.
    1. Slope m = (5 − (−1))/(5 − 2) = 6/3 = 2.
    2. Point-slope form: y + 1 = 2(x − 2), so y = 2x − 5, or 2x − y − 5 = 0.
    3. x-intercept: put y = 0 to get x = 5/2. y-intercept: put x = 0 to get y = −5.
    Answer: 2x − y − 5 = 0; x-intercept 5/2, y-intercept −5
  4. Find the equation of the line through (3, 4) that is perpendicular to 2x − 3y + 5 = 0.
    1. Perpendicular to ax + by + c = 0 means the form bx − ay + k = 0: here −3x − 2y + k = 0, or 3x + 2y = k.
    2. Put in (3, 4): 9 + 8 = k, so k = 17.
    3. Check by slopes: the given line has slope 2/3 and the new line has slope −3/2; the product is −1.
    Answer: 3x + 2y − 17 = 0
  5. Find the acute angle between the lines y = 3x + 1 and y = −2x + 4.
    1. Slopes: m₁ = 3 and m₂ = −2.
    2. tan θ = |(3 − (−2))/(1 + 3 × (−2))| = |5/(−5)| = 1.
    3. So the acute angle is θ = 45°.
    Answer: 45°
  6. Find (a) the distance of the point (3, −2) from the line 4x − 3y + 7 = 0 and (b) the distance between the parallel lines 3x + 4y − 7 = 0 and 6x + 8y + 1 = 0.
    1. (a) d = |4(3) − 3(−2) + 7|/√(16 + 9) = |12 + 6 + 7|/5 = 25/5 = 5.
    2. (b) Divide the second equation by 2 so that the coefficients match: 3x + 4y + 1/2 = 0.
    3. d = |−7 − 1/2|/√(9 + 16) = (15/2)/5 = 3/2.
    Answer: (a) 5; (b) 3/2

Exam shortcuts

Common mistakes

Practice MCQs

  1. The distance between the points (1, 2) and (4, 6) is:
    A) 7
    B) 25
    C) 5
    D) √7
    Answer: C) 5 — √[(4 − 1)² + (6 − 2)²] = √(9 + 16) = √25 = 5. Adding the differences 3 + 4 gives 7, and 25 forgets the square root.
  2. The slope of the line through (2, −3) and (−1, 6) is:
    A) 3
    B) −3
    C) −1/3
    D) 1/3
    Answer: B) −3 — m = (6 − (−3))/(−1 − 2) = 9/(−3) = −3. Putting the x-difference on top gives −1/3.
  3. The slope of the line 3x − 4y + 12 = 0 is:
    A) −3/4
    B) 4/3
    C) 3/4
    D) −4/3
    Answer: C) 3/4 — Slope = −a/b = −3/(−4) = 3/4. Rearranging gives the same thing: 4y = 3x + 12, so y = (3/4)x + 3.
  4. The intercepts of the line 2x + 5y = 20 on the x-axis and y-axis are:
    A) 4 and 10
    B) 10 and 4
    C) 2 and 5
    D) −10 and −4
    Answer: B) 10 and 4 — Put y = 0: 2x = 20, so the x-intercept is 10. Put x = 0: 5y = 20, so the y-intercept is 4. In intercept form the line is x/10 + y/4 = 1.
  5. The centroid of the triangle with vertices (1, 2), (3, −4) and (5, 8) is:
    A) (3, 2)
    B) (9, 6)
    C) (4.5, 3)
    D) (3, −2)
    Answer: A) (3, 2) — Centroid = ((1 + 3 + 5)/3, (2 − 4 + 8)/3) = (9/3, 6/3) = (3, 2). (9, 6) forgets to divide by 3, and (4.5, 3) divides by 2.
  6. The point dividing the join of (−3, 5) and (6, −4) internally in the ratio 1 : 2 is:
    A) (3, −1)
    B) (1.5, 0.5)
    C) (−12, 14)
    D) (0, 2)
    Answer: D) (0, 2) — x = (1 × 6 + 2 × (−3))/3 = 0 and y = (1 × (−4) + 2 × 5)/3 = 2. Swapping the ratio gives (3, −1), the 2 : 1 point; (1.5, 0.5) is the midpoint and (−12, 14) is the external point.
  7. The line with slope −2 and y-intercept 3 is:
    A) 2x + y − 3 = 0
    B) 2x − y + 3 = 0
    C) x + 2y − 3 = 0
    D) 2x + y + 3 = 0
    Answer: A) 2x + y − 3 = 0 — y = −2x + 3 rearranges to 2x + y − 3 = 0. Check: putting x = 0 gives y = 3, and the slope −a/b = −2/1 = −2.
  8. The line that cuts off intercepts 3 and −4 on the x-axis and y-axis is:
    A) 3x − 4y = 12
    B) 4x + 3y = 12
    C) 4x − 3y = 12
    D) 4x − 3y + 12 = 0
    Answer: C) 4x − 3y = 12 — Intercept form: x/3 + y/(−4) = 1. Multiply by 12: 4x − 3y = 12. Check: (3, 0) and (0, −4) both satisfy it.
  9. The lines 2x + 3y = 7 and kx − 4y + 1 = 0 are perpendicular when k equals:
    A) 6
    B) −6
    C) −8/3
    D) 3/2
    Answer: A) 6 — Perpendicular means a₁a₂ + b₁b₂ = 0: 2k + 3(−4) = 0, so k = 6. The value −8/3 would make the lines parallel instead.
  10. The points (1, 2), (3, k) and (5, 8) are collinear when k equals:
    A) 4
    B) 6
    C) 5
    D) 3
    Answer: C) 5 — The slope from (1, 2) to (5, 8) is 6/4 = 3/2. From (1, 2) to (3, k) it is (k − 2)/2, and setting (k − 2)/2 = 3/2 gives k = 5. Here (3, 5) is in fact the midpoint.
  11. The acute angle between the lines y = x and y = √3x is:
    A) 75°
    B) 15°
    C) 30°
    D) 45°
    Answer: B) 15° — The lines make 45° and 60° with the x-axis, so the angle between them is 60° − 45° = 15°. The formula agrees: tan θ = (√3 − 1)/(1 + √3) = 2 − √3 = tan 15°.
  12. The perpendicular distance of the origin from the line 5x − 12y + 26 = 0 is:
    A) 26
    B) 26/17
    C) 1/2
    D) 2
    Answer: D) 2 — d = |c|/√(a² + b²) = 26/√(25 + 144) = 26/13 = 2. Dividing by 5 + 12 = 17 instead of √169 gives 26/17.
  13. The distance between the parallel lines 3x − 4y + 9 = 0 and 6x − 8y − 2 = 0 is:
    A) 2
    B) 11/5
    C) 7/5
    D) 1
    Answer: A) 2 — Halve the second equation: 3x − 4y − 1 = 0. Then d = |9 − (−1)|/√(9 + 16) = 10/5 = 2. Using −2 without halving gives 11/5.
  14. The area of the triangle with vertices (1, 1), (4, 5) and (−2, 3) is:
    A) 18
    B) 6
    C) 12
    D) 9
    Answer: D) 9 — Area = ½|1(5 − 3) + 4(3 − 1) + (−2)(1 − 5)| = ½|2 + 8 + 8| = ½ × 18 = 9. Forgetting the ½ gives 18.
  15. The image (reflection) of the point (2, 1) in the line x + y = 5 is:
    A) (3, 2)
    B) (4, 3)
    C) (3, 4)
    D) (−2, −1)
    Answer: B) (4, 3) — The foot of the perpendicular satisfies (h − 2)/1 = (k − 1)/1 = −(2 + 1 − 5)/2 = 1, giving (3, 2). The image is twice as far: (h − 2)/1 = (k − 1)/1 = 2, giving (4, 3). Check: the midpoint (3, 2) lies on x + y = 5. (3, 2) is the foot, not the image.

Questions

Which form of the equation of a line should I use?

Match the form to the data: point and slope → point-slope; two points → two-point; both intercepts → intercept form; slope and y-intercept → y = mx + c. Convert the result to ax + by + c = 0 to compare with MCQ options.

How do I find the slope of a vertical line?

A vertical line x = k has undefined (infinite) slope, because the run is zero. Use the test a₁a₂ + b₁b₂ = 0 for perpendicularity in such cases; it works for every line.

What is the difference between internal and external division?

In internal division the point lies between A and B and the formula uses m + n. In external division it lies on AB extended beyond A or B, and the formula uses m − n with minus signs in the numerators.

How do I find the distance between two parallel lines?

Write both equations with the same x and y coefficients, ax + by + c₁ = 0 and ax + by + c₂ = 0. The distance is |c₁ − c₂|/√(a² + b²). Alternatively, take any point on one line and find its distance from the other.