Lines in the plane: slope, equations and distance
Distance and midpoint between two points, slope as an angle, the equation of a line from a point and a slope or from two points, parallel and perpendicular lines, and the distance from a point to a line.
First, the rules
Geometry with coordinates
Pythagoras on the horizontal and vertical legs.
α is the angle the line makes with the positive x-axis. Vertical line: no slope; horizontal: m = 0.
See it
Drag two points
The dashed legs are Δx and Δy; the slope is their ratio, the distance their hypotenuse. The green dot is the midpoint. Make the line vertical and watch the slope vanish.
Step by step
Worked examples
Distance, midpoint, slope
two pointsA(−2, 1) and B(4, 9). Find |AB|, the midpoint of AB and the slope of AB.
Ask yourself: Compute Δx and Δy once — all three answers use them.
Show the solution
- Δx = 6, Δy = 8, so |AB| = √36 + 64 = 10 (a 6-8-10 triangle).
- Midpoint (−2 + 42, 1 + 92) = (1, 5).
- Slope m = 86 = 43.
Answer 10; (1, 5); 43
A perpendicular through a point
point–slopeFind the equation of the line through P(3, −1) perpendicular to the line 2x − 3y + 6 = 0. Give it in the form y = mx + n.
Ask yourself: First the slope of the given line (solve for y), then the negative reciprocal.
Show the solution
- Given line: y = 23x + 2, slope 2/3.
- Perpendicular slope: m = −32 (product −1).
- Through (3, −1): y + 1 = −32(x − 3) ⇒ y = −32x + 72.
Answer y = −32x + 72
Distance from a point to a line
formulaHow far is the point (1, −2) from the line 3x + 4y − 5 = 0? Where do that line and x − 2y = 0 meet?
Ask yourself: The distance formula wants the general form ax + by + c = 0 — this one already is.
Show the solution
- d = |3 · 1 + 4 · (−2) − 5|√9 + 16 = |−10|5 = 2.
- Intersection: from the second line x = 2y; into the first: 6y + 4y − 5 = 0 ⇒ y = 12, x = 1.
Answer 2; (1, 12)
Practice: lines in the plane
0 / 0Distance, midpoint, slope, equation through a point, perpendicular slope and point–line distance — exact answers. Your best score is kept in this browser only.
About this lesson
Analytic geometry of the line: the distance between two points and the midpoint, the slope m = Δy / Δx and its link to the angle with the x-axis (m = tan α), the point–slope and two-point forms, the general form ax + by + c = 0, parallel lines (same slope) and perpendicular lines (m₁ · m₂ = −1), the intersection of two lines, and the distance from a point to a line. Drag two points and read everything live, then practise.
Part of Learn mathematics · Grade 11 · Analytic geometry. Check a number with the scientific calculator or draw a function with the function plotter. Everything on this page runs in your browser; nothing you type is sent or stored, and your practice score stays in this browser only. Spotted an error? Tell us.