# Equation of a straight line

The general equation of a straight line is:

$y = mx + c$

where m is the and c is the (where the straight line cuts the y-axis)

### Example

Find the gradient and y-intercept for the straight line with equation $$y = 5x + 7$$?

$m=5$

$$c=7$$ so y-intercept is (0, 7)

Try these example questions

Question

Find the gradient and y-intercept for the straight line with equation $$y = 2x + 3$$

$m = 2$

$$c = 3$$ so y-intercept is (0, 3).

Question

Find the gradient and y-intercept for the straight line with equation $$y = 8x - 4$$

$m = 8$

$$c = -4$$ so y-intercept is (0, -4).

Question

Find the equation of the straight line shown below.

To find the equation of a straight line we need to know the gradient and the y-intercept.

Looking at the graph, the straight line cuts the y-axis at (0, 3) therefore c = 3.

Remember that the to calculate the gradient is:

$Gradient(m) = \frac{{vertical\,distance}}{{horizontal\,distance}}$

Therefore $$m = \frac{3}{6} = \frac{1}{2}$$

Since the straight line shown above is a downward slope, then:

$m = - \frac{1}{2}$

So, the equation of the straight line is:

$y = - \frac{1}{2}x + 3$

Question

Find the equation of the straight line shown below.

y-intercept is (-3, 0) therefore c = -3

$m = \frac{v}{h} = \frac{8}{7}$

Therefore, the equation of the straight line is:

$y = \frac{8}{7}x - 3$

Question

Which of these lines in the above diagram are horizontal and which are vertical?

$y = 6$

$x= 3$

$x = -4$

$y = -8$

Horizontal lines:$$y =6$$ and $$y = -8$$.

Vertical lines:$$x=3$$ and $$x= 4$$.