Equation of a Line Calculator – Standard, Slope-Intercept & Parametric Form
📐 Struggling with Finding the Equation of a Line in the Coordinate Plane?
The equation of a line is one of the most fundamental concepts in coordinate geometry. Mastering it helps you solve a wide range of problems involving relative positions, distances and angles between lines.
ATMath.org’s Line Equation Calculator helps you:
- ✅ Find the equation of a line through 2 distinct points A, B
- ✅ Find the equation through point M with a normal vector n or a direction vector u
- ✅ Find the equation through point M with a known slope k
- ✅ Find a line parallel or perpendicular to a given line
- ✅ Output 3 forms at once: general, parametric, slope-intercept
- ✅ Draw an SVG graph on the coordinate plane
- ✅ Show detailed step-by-step solutions
📋 Enter coordinates of 2 distinct points:
📋 Enter point M and vector:
📋 Enter point M and condition:
🎯 Line Equation Knowledge Quiz
📚 Basic Knowledge of Line Equations
1. Forms of Line Equations
📌 3 Basic Forms of Line Equations
| Form | Formula | Condition |
|---|---|---|
| 1. General form | ax + by + c = 0 | a2 + b2 ≠ 0 Normal vector: n = (a; b) |
| 2. Parametric form | x = x0 + u1 t ; y = y0 + u2 t (t ∈ R) | u12 + u22 ≠ 0 Direction vector: u = (u1; u2) |
| 3. Slope-intercept form | y = kx + m | k: slope m: y-intercept |
Important notes:
• The general form is the most universal: it describes every line.
• The slope-intercept form does NOT apply to vertical lines (parallel to the y-axis).
• Intercept form: x/a + y/b = 1 (the line meets the x-axis at (a; 0) and the y-axis at (0; b)).
2. Normal Vector and Direction Vector
🎯 Definitions and Relationship
Normal vector n = (a; b):
A non-zero vector perpendicular to line d.
If d has equation ax + by + c = 0, then n = (a; b) is a normal vector of d.
Direction vector u = (u1; u2):
A non-zero vector parallel to (or lying on) line d.
If d passes through A(xA; yA) and B(xB; yB), then u = AB = (xB – xA; yB – yA) is a direction vector of d.
🔄 Converting between normal and direction vectors:
| Given | Find | Formula |
|---|---|---|
| n = (a; b) | u | u = (-b; a) or (b; -a) |
| u = (u1; u2) | n | n = (-u2; u1) or (u2; -u1) |
Remember: the normal vector and the direction vector are always PERPENDICULAR.
Check: n ⊥ u ⇔ a u1 + b u2 = 0
🔢 5 Classic Cases of Finding Line Equations
Case 1: Line Through 2 Distinct Points A, B
📊 Method:
Step 1: Direction vector AB = (xB – xA; yB – yA)
Step 2: Normal vector n = (yA – yB; xB – xA)
Step 3: General equation through A with normal vector n:
(yA – yB)(x – xA) + (xB – xA)(y – yA) = 0
Step 4: Expand and simplify to ax + by + c = 0
Example: Find the line through A(1; 2) and B(3; 4)
Solution:
• AB = (3 – 1; 4 – 2) = (2; 2)
• n = (-2; 2) = 2(-1; 1), choose n = (-1; 1)
• Equation: -(x – 1) + (y – 2) = 0 ⇔ -x + y – 1 = 0 ⇔ x – y + 1 = 0
Case 2: Line Through Point M with a Known Normal Vector n
📊 Method:
Direct formula: the line d through M(x0; y0) with normal vector n = (a; b) is:
a(x – x0) + b(y – y0) = 0
Example: Find the line through M(1; -2) with normal vector n = (2; 3)
Solution:
2(x – 1) + 3(y + 2) = 0 ⇔ 2x – 2 + 3y + 6 = 0 ⇔ 2x + 3y + 4 = 0
Case 3: Line Through Point M with a Known Direction Vector u
📊 Method:
Step 1: From u = (u1; u2) get n = (-u2; u1)
Step 2: Apply -u2(x – x0) + u1(y – y0) = 0
Or write the parametric form directly:
x = x0 + u1 t ; y = y0 + u2 t (t ∈ R)
Example: Find the line through M(3; 5) with direction vector u = (4; -1)
Solution: u = (4; -1) ⇒ n = (1; 4)
(x – 3) + 4(y – 5) = 0 ⇔ x + 4y – 23 = 0
Parametric form:
x = 3 + 4t ; y = 5 – t (t ∈ R)
Case 4: Line Through Point M with a Known Slope k
📊 Method:
Point-slope formula: the line d through M(x0; y0) with slope k is:
y – y0 = k(x – x0)
Or in slope-intercept form y = kx + m with m = y0 – k x0.
Example: Find the line through M(2; 3) with slope k = 2
Solution:
y – 3 = 2(x – 2) ⇔ y = 2x – 1 (slope-intercept) ⇔ 2x – y – 1 = 0 (general)
About the slope:
• If d: ax + by + c = 0 with b ≠ 0, then k = -a/b
• If b = 0 (vertical line), the slope is undefined
• A horizontal line has k = 0
• If the line makes angle α with the positive x-axis, then k = α
Case 5: Line Parallel or Perpendicular to a Given Line
📊 Method:
| Condition | Normal vector | Equation |
|---|---|---|
| d // d0: Ax + By + C = 0 | n = (A; B) | Ax + By + C' = 0 (C' ≠ C) |
| d ⊥ d0: Ax + By + C = 0 | n = (-B; A) | Bx – Ay + C' = 0 |
Example: Find the line d through M(1; 2) perpendicular to d0: 3x – 4y + 5 = 0
Solution: n0 = (3; -4), so d has normal vector n = (4; 3).
4(x – 1) + 3(y – 2) = 0 ⇔ 4x + 3y – 10 = 0
Check: n0 · n = 3 · 4 + (-4) · 3 = 0 ✓
⚠️ Common Mistakes
❌ Mixing up normal and direction vectors: the line through M(1; 2) with direction vector u = (3; 4) is NOT 3(x – 1) + 4(y – 2) = 0.
✅ Correct: n = (-4; 3), so -4(x – 1) + 3(y – 2) = 0 ⇔ 4x – 3y + 2 = 0
❌ Not simplifying: 6x + 9y – 12 = 0 should be divided by (6, 9, 12) = 3: 2x + 3y – 4 = 0.
❌ Forgetting vertical lines: through A(2; 3) and B(2; 5) the line is x = 2, which has no slope.
❓ 5 Frequently Asked Questions (FAQ)
1. When should I use the normal vector and when the direction vector?
- Normal vector n = (a; b): when writing the general form ax + by + c = 0 or when the problem gives a normal vector.
- Direction vector u = (u1; u2): when writing the parametric form or when the problem gives a direction vector.
- Conversion: n = (a; b) ⇒ u = (-b; a); u = (u1; u2) ⇒ n = (-u2; u1).
2. Why doesn’t the slope-intercept form apply to vertical lines?
A vertical line has the form x = x0. One value of x corresponds to infinitely many values of y, so it cannot be written as y = kx + m.
3. When are two lines coincident?
Lines d: ax + by + c = 0 and d': a'x + b'y + c' = 0 (with non-zero coefficients in d’) coincide if and only if:
a/a' = b/b' = c/c'
Example: 2x + 3y – 6 = 0 and 4x + 6y – 12 = 0 coincide because 2/4 = 3/6 = -6/-12 = 1/2.
4. How do I find where a line meets the coordinate axes?
For d: ax + by + c = 0:
- x-axis (y = 0): x = -c/a (if a ≠ 0).
- y-axis (x = 0): y = -c/b (if b ≠ 0).
5. How many lines pass through a given point?
Infinitely many. To determine a unique line you also need a second point, a vector (normal or direction), a slope, or a parallel/perpendicular condition.
🔗 Related Tools
💡 Study tip: Memorize a(x – x0) + b(y – y0) = 0 and the conversion between normal and direction vectors. This is the foundation for every line equation problem!