Home / Articles / Geometry & Trigonometry
Geometry & Trigonometry · 4 min read

Equation of a Straight Line in All Its Forms

Learn every form of the equation of a straight line, including slope-intercept, point-slope, two-point, intercept, normal and general, with worked examples.

A straight line can be described by several different equations, and each one is convenient for a particular kind of information. Matric, FSc and O/A Level papers expect you to choose the right form, switch between forms and use them to find intersections, parallels and perpendiculars. This guide covers every standard form with step-by-step examples.

Why So Many Forms?

All the forms describe the same thing: a line on the \( xy \)-plane. They differ only in which facts they use. If you know the slope and the \( y \)-intercept, one form fits; if you know two points, another is quicker. Choosing well saves time and reduces errors.

Throughout, \( m \) is the slope (gradient), and \( (x_1, y_1) \) is a known point.

1. Slope-Intercept Form

$$ y = mx + c $$

Here \( c \) is the \( y \)-intercept, where the line crosses the \( y \)-axis at \( (0, c) \). This is the best form for sketching and for reading off the slope directly.

Example: \( y = -3x + 4 \) has slope \( -3 \) and crosses the \( y \)-axis at \( (0, 4) \).

2. Point-Slope Form

$$ y - y_1 = m(x - x_1) $$

Use this when you know the slope and any single point on the line. It is the most flexible form for building an equation from scratch.

3. Two-Point Form

When you know two points \( (x_1, y_1) \) and \( (x_2, y_2) \):

$$ \frac{y - y_1}{y_2 - y_1} = \frac{x - x_1}{x_2 - x_1} $$

In practice, many students simply find the slope \( m = \dfrac{y_2 - y_1}{x_2 - x_1} \) first, then use point-slope form. Both methods give the same result.

4. Intercept Form

If the line cuts the \( x \)-axis at \( (a, 0) \) and the \( y \)-axis at \( (0, b) \):

$$ \frac{x}{a} + \frac{y}{b} = 1 $$

This form is ideal for questions about intercepts or the area of the triangle a line makes with the axes, which is \( \tfrac12 |ab| \).

5. Normal (Perpendicular) Form

If \( p \) is the perpendicular distance from the origin to the line and \( \alpha \) is the angle that perpendicular makes with the positive \( x \)-axis:

$$ x\cos\alpha + y\sin\alpha = p $$

This form appears in the FSc Part 2 syllabus and in university analytic geometry.

6. General Form

$$ ax + by + c = 0 $$

Every line can be written this way. The slope is \( m = -\dfrac{a}{b} \) (when \( b \neq 0 \)), and the vertical line \( x = k \) is included as the case \( b = 0 \). Many examiners ask for final answers in this form, usually with integer coefficients.

Special Lines

  • Horizontal: \( y = k \) (slope 0)
  • Vertical: \( x = k \) (slope undefined)
  • Through the origin: \( y = mx \)

Worked Example 1: Line Through Two Points

Question: Find the equation of the line through \( A(1, 5) \) and \( B(4, -1) \) in slope-intercept, general and intercept forms.

Step 1: Slope.

$$ m = \frac{-1 - 5}{4 - 1} = \frac{-6}{3} = -2 $$

Step 2: Point-slope form using \( A \).

$$ y - 5 = -2(x - 1) $$

Step 3: Slope-intercept form.

$$ y - 5 = -2x + 2 \quad\Rightarrow\quad y = -2x + 7 $$

Step 4: General form.

$$ 2x + y - 7 = 0 $$

Step 5: Intercept form. Move the constant across and divide by 7:

$$ 2x + y = 7 \quad\Rightarrow\quad \frac{x}{7/2} + \frac{y}{7} = 1 $$

The intercepts are \( \left(\tfrac72, 0\right) \) and \( (0, 7) \).

Check with \( B \): \( 2(4) + (-1) - 7 = 8 - 1 - 7 = 0 \). Correct.

Worked Example 2: A Perpendicular Line

Question: Find the equation of the line through \( (3, 1) \) that is perpendicular to \( 2x - y + 5 = 0 \).

Step 1: Slope of the given line. Rearrange: \( y = 2x + 5 \), so \( m_1 = 2 \).

Step 2: Perpendicular slope.

$$ m_2 = -\frac{1}{m_1} = -\frac12 $$

Step 3: Point-slope form.

$$ y - 1 = -\frac12(x - 3) $$

Step 4: Clear the fraction. Multiply both sides by 2:

$$ 2y - 2 = -x + 3 \quad\Rightarrow\quad x + 2y - 5 = 0 $$

Check: \( 3 + 2(1) - 5 = 0 \), and the slopes multiply to \( 2 \times (-\tfrac12) = -1 \). Correct.

Worked Example 3: Converting to Normal Form

Question: Write \( 3x + 4y - 10 = 0 \) in normal form and state the distance of the line from the origin.

Step 1: Move the constant to the right so it is positive.

$$ 3x + 4y = 10 $$

Step 2: Divide by \( \sqrt{a^2 + b^2} = \sqrt{9 + 16} = 5 \).

$$ \frac{3}{5}x + \frac{4}{5}y = 2 $$

Step 3: Compare with \( x\cos\alpha + y\sin\alpha = p \). Here \( \cos\alpha = \tfrac35 \), \( \sin\alpha = \tfrac45 \) and \( p = 2 \). The line is 2 units from the origin, and \( \alpha = \cos^{-1}(0.6) \approx 53.13^\circ \).

A Related Formula: Distance from a Point to a Line

The perpendicular distance from \( (x_1, y_1) \) to \( ax + by + c = 0 \) is:

$$ d = \frac{|ax_1 + by_1 + c|}{\sqrt{a^2 + b^2}} $$

For the point \( (1, 2) \) and the line \( 3x + 4y - 10 = 0 \):

$$ d = \frac{|3 + 8 - 10|}{5} = \frac{1}{5} = 0.2 $$

Tips

  • Two points given? Find the slope first, then use point-slope form.
  • Intercepts mentioned? Reach for intercept form.
  • Final answer? Give general form with integer coefficients unless told otherwise.
  • Always check by substituting a known point into your final equation.

Common Mistakes

  • Reading the slope from general form incorrectly. For \( 2x - y + 5 = 0 \), the slope is \( -\tfrac{2}{-1} = 2 \), not \( -2 \).
  • Sign errors in point-slope form. For the point \( (-2, 3) \), write \( y - 3 = m(x + 2) \).
  • Forgetting that \( p \) must be positive in normal form.
  • Writing a vertical line as \( y = mx + c \). It cannot be; use \( x = k \).

Key Takeaways

  • Slope-intercept \( y = mx + c \) is best for sketching and reading the slope.
  • Point-slope \( y - y_1 = m(x - x_1) \) builds an equation from one point and a slope.
  • Intercept form \( \tfrac{x}{a} + \tfrac{y}{b} = 1 \) handles axis intercepts.
  • Normal form gives the distance from the origin; general form \( ax + by + c = 0 \) covers every line.
  • Parallel lines share a slope; perpendicular slopes multiply to \( -1 \).

If straight-line questions or a coordinate geometry assignment are slowing you down, send them to Amathify on WhatsApp or through the "Ask a Question" form for step-by-step solutions from our subject experts and PhD scholars.

Stuck on a problem or assignment?

Our experts and PhD scholars solve maths, physics and chemistry — step by step.

WhatsApp usAsk a question

Related articles