The equation of a straight line can be given in two main forms:
y = mx + c | called the gradient/intercept form | e.g. y = 2x + 3 |
ax + by + c = 0 | called the general form |
e.g. 3x + 4y + 6 = 0 |
The equation of a straight line can be worked out in several ways depending on the information given about the line.
Equation of line given the gradient and the y-intercept
If the gradient of a line is given and the y-intercept is known, then this information can be substituted into the formula
y = mx + c where m is the gradient c is the y-intercept. |
The equation can then be simplified into one of the two forms above.
See example
Equation of line given the gradient and a point it passes through
If the gradient of a line is given and the coordinates of a point the line passes through are known this information can be substituted into the formula:
y − y_{1}= m(x − x_{1}) where m is the gradient (x_{1}, y_{1}) is a point on the line. |
See example
Equation of line given two points it passes through
If two different points that the line passes through are known this information can be substituted into the formula:
(x_{1}, y_{1}) is one point on the line and (x_{2}, y_{2}) is another. |
See example
An alternative way, rather than use the complicated formula above is to work out the gradient of the line joining the two points and then use the formula y − y_{1}= m(x − x_{1})
The last two formulas are often given to students in tests and examinations.