- Foundation
- About 17 min
- 5 practice questions
Equations of a line: horizontal, vertical, point-slope and two-point forms
Write the equation of a horizontal or vertical line, derive the point-slope and two-point forms, and use them to find lines such as medians and linear relations.
If something looks wrong, please tell us.
A line contains infinitely many points. Its equation is a condition on x and y that is true for every point on the line and false for every point off it. Once we have the equation, deciding whether a point is on the line takes one substitution. This lesson builds the first family of forms from two facts we already have: a line is fixed by a point and a slope, or by two points.
Lines parallel to the axes
Every point of a horizontal line at distance a from the x-axis has the same y-coordinate, so its equation is y = a (above the x-axis) or y = −a (below). Similarly a vertical line at distance b from the y-axis is x = b or x = −b. For example, the lines through (3, −5) parallel to the axes are y = −5 (parallel to the x-axis) and x = 3 (parallel to the y-axis). The x-axis itself is y = 0 and the y-axis is x = 0.
Point-slope form
Let L be a non-vertical line with slope m through a fixed point P₀(x₀, y₀), and let P(x, y) be any other point of L. By the slope formula, m = (y − y₀)/(x − x₀). Multiplying out:
Point-slope form: y − y₀ = m(x − x₀).
Every point of L, including P₀ itself, satisfies this equation, and no point off L does (a point off L would give a different slope with P₀). So it really is the equation of L.
Worked example 1: point and slope
Find the line through (2, −1) with slope 3. y − (−1) = 3(x − 2), so y + 1 = 3x − 6, giving 3x − y − 7 = 0. Check: 3(2) − (−1) − 7 = 6 + 1 − 7 = 0.
Worked example 2: point and inclination
Find the line through (0, 2) with inclination 135°. m = tan 135° = −1, so y − 2 = −1(x − 0), that is x + y − 2 = 0. A parallel line crossing the y-axis 2 units below the origin passes through (0, −2) with the same slope: y + 2 = −x, or x + y + 2 = 0.
Two-point form
Let the line pass through P₁(x₁, y₁) and P₂(x₂, y₂) with x₁ ≠ x₂, and let P(x, y) be a general point on it. The three points are collinear, so slope of P₁P = slope of P₁P₂:
Two-point form: y − y₁ = [(y₂ − y₁)/(x₂ − x₁)] (x − x₁).
This is just the point-slope form with m replaced by the slope through the two given points.
Choosing the form of the equation of a line
-
You know a point and the slope
- Point-slope: y − y₀ = m(x − x₀)
-
You know two points
- Two-point: find m, then point-slope
-
Line is parallel to an axis
- y = a (horizontal)
- x = b (vertical)
-
You know slope and y-intercept
- Slope-intercept: y = mx + c (next lesson)
-
You know both intercepts
- Intercept form: x/a + y/b = 1 (next lesson)
Worked example 3: two points
Find the line through (2, 3) and (−1, −3). Slope = (−3 − 3)/(−1 − 2) = −6/−3 = 2. Then y − 3 = 2(x − 2), so 2x − y − 1 = 0. Check with the other point: 2(−1) − (−3) − 1 = −2 + 3 − 1 = 0.
Worked example 4: the median of a triangle
Triangle PQR has vertices P(1, 4), Q(3, −2), R(−3, 2). Find the equation of the median through R. The median joins R to the mid-point of PQ, which is ((1 + 3)/2, (4 − 2)/2) = (2, 1). Slope from R(−3, 2) to (2, 1) = (1 − 2)/(2 + 3) = −1/5. So y − 2 = −(1/5)(x + 3); multiplying by 5, 5y − 10 = −x − 3, giving x + 5y − 7 = 0. Check: (2, 1) gives 2 + 5 − 7 = 0 and (−3, 2) gives −3 + 10 − 7 = 0.
Worked example 5: a linear relation from two readings
In a made-up spring experiment, the length L of a spring is 12 cm under a load of 2 kg and 15 cm under 8 kg, and L depends linearly on the load W. Treat (W, L) as points (2, 12) and (8, 15). Slope = (15 − 12)/(8 − 2) = 0.5 cm per kg. So L − 12 = 0.5(W − 2), giving L = 0.5W + 11. Under a 10 kg load the model predicts L = 5 + 11 = 16 cm. This is how two measurements fix a straight-line law.
Worked example 6: is the point on the line?
Is (4, 5) on the line 2x − y − 1 = 0 from worked example 3? Substitute: 2(4) − 5 − 1 = 2 ≠ 0. No, the point is not on the line. The point (4, 7) is: 8 − 7 − 1 = 0.
Key takeaways
- Horizontal lines: y = constant; vertical lines: x = constant.
- Point-slope: y − y₀ = m(x − x₀).
- Two-point: find m = (y₂ − y₁)/(x₂ − x₁), then use point-slope.
- A point lies on a line exactly when its coordinates satisfy the equation.
Check your understanding
-
1. The equation of the line through (−4, 7) parallel to the x-axis is:
- x = −4
- y = 7
- y = −4
- x = 7
Show answer
Answer: B. A line parallel to the x-axis has every point with the same y-coordinate, here 7. So its equation is y = 7.
-
2. Which is the equation of the line through (1, 2) with slope −3?
- 3x + y − 5 = 0
- 3x − y − 1 = 0
- x + 3y − 7 = 0
- 3x + y + 5 = 0
Show answer
Answer: A. y − 2 = −3(x − 1) gives y − 2 = −3x + 3, so 3x + y − 5 = 0. Check: 3(1) + 2 − 5 = 0.
-
3. Find the equation of the line through (0, −1) and (2, 3).
- x − 2y − 2 = 0
- 2x + y + 1 = 0
- 2x − y + 1 = 0
- 2x − y − 1 = 0
Show answer
Answer: D. Slope = (3 − (−1))/(2 − 0) = 2. y + 1 = 2(x − 0) gives 2x − y − 1 = 0. Check (2, 3): 4 − 3 − 1 = 0.
-
4. Triangle ABC has A(0, 0), B(4, 2), C(2, 6). Which line is the median through C?
- x = 2
- y = 6
- x + y = 8
- y = 3x
Show answer
Answer: A. The mid-point of AB is (2, 1). The median joins C(2, 6) to (2, 1); both have x = 2, so the median is the vertical line x = 2.
-
5. Assertion (A): The two-point form cannot be used for the points (3, 1) and (3, 8). Reason (R): The line through them is vertical, so x₂ − x₁ = 0 and its slope is not defined; its equation is x = 3.
- Both A and R are true, and R is the correct explanation of A
- Both A and R are true, but R is not the correct explanation of A
- A is true, but R is false
- A is false, but R is true
Show answer
Answer: A. Both are true. The two-point form divides by x₂ − x₁, which is 0 here, so it cannot be used. The line is vertical, with equation x = 3. R explains A.
Sign in to keep track of the lessons you finish.