Skip to content
spmaddmath.com.my
Tuition

Study

SyllabusFormulasMethodsExam & PapersTools
LocationsPricingBlogOur TeachersContact
EN

Method · Coordinate Geometry

Finding the equation of a straight line

Fix the direction of the line with its gradient mm, then anchor it to one known point using yy1=m(xx1)y - y_1 = m(x - x_1), and rearrange into y=mx+cy = mx + c.

What this method is for

This method turns geometric information into the algebraic equation of a straight line, usually in gradient-intercept form y=mx+cy = mx + c or the general form ax+by+c=0ax + by + c = 0. The information can be two points that lie on the line, a single point together with the gradient, or a point together with a line that the new line is parallel or perpendicular to.

It answers questions such as 'find the equation of the line joining AA and BB', 'find the equation of the line through PP with gradient 22', or 'find the equation of the perpendicular bisector of ABAB'. Once you have the equation you can find its axis intercepts, test whether a point lies on it, or find where it meets another line, so it is one of the most reused skills in the whole Coordinate Geometry chapter.

point-gradient form
yy1=m(xx1)y - y_1 = m(x - x_1)
gradient-intercept form
y=mx+cy = mx + c

When to reach for it

Reach for this method whenever a question asks you to 'find the equation of the straight line' and gives enough to fix both its direction (a gradient) and its position (one point it passes through). The common signals are: two named points on the line, a single point plus a stated gradient, or a point plus a parallel or perpendicular condition such as 'parallel to y=3x+1y = 3x + 1' or 'perpendicular to ABAB'.

If only a gradient is given with no point, the line is not yet pinned down, search the question for the point. When a parallel or perpendicular line is mentioned, first read off that line's gradient, then convert it: keep the same value for a parallel line, or take the negative reciprocal m2=1m1m_2 = -\frac{1}{m_1} for a perpendicular line, before you substitute a point.

The steps

  1. 1

    Identify what you are given

    Two points, or one point and a gradient, or one point and a parallel/perpendicular line.

  2. 2

    Find the gradient

    From two points use m=y2y1x2x1m = \frac{y_2 - y_1}{x_2 - x_1}. For a parallel line use the same gradient; for a perpendicular line use m2=1m1m_2 = -\frac{1}{m_1}.

  3. 3

    Choose one point

    Pick a point (x1,y1)(x_1, y_1) that the line passes through, either one works if you have two.

  4. 4

    Substitute into point-gradient form

    Write yy1=m(xx1)y - y_1 = m(x - x_1) using your gradient and chosen point.

  5. 5

    Expand and rearrange

    Multiply out the bracket and collect terms into y=mx+cy = mx + c, or the general form ax+by+c=0ax + by + c = 0 if the question asks for it.

  6. 6

    Check with the other point

    Substitute a second known point into your equation; both sides should agree.

Worked example

Q1[3 marks]

Find the equation of the straight line that passes through the points A(1,2)A(1, 2) and B(3,8)B(3, 8). Give your answer in the form y=mx+cy = mx + c.

Show worked solution

First find the gradient using the two points. Take (x1,y1)=(1,2)(x_1, y_1) = (1, 2) and (x2,y2)=(3,8)(x_2, y_2) = (3, 8).

m=y2y1x2x1=8231=62=3m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{8 - 2}{3 - 1} = \frac{6}{2} = 3

Now substitute the gradient m=3m = 3 and the point A(1,2)A(1, 2) into the point-gradient form.

y2=3(x1)y - 2 = 3(x - 1)

Expand the bracket and rearrange to make yy the subject.

y2=3x3y - 2 = 3x - 3
y=3x3+2=3x1y = 3x - 3 + 2 = 3x - 1

So the equation of the line is y=3x1y = 3x - 1. Check with the other point B(3,8)B(3, 8): substituting x=3x = 3 gives y=3(3)1=91=8y = 3(3) - 1 = 9 - 1 = 8, which matches the yy-coordinate of BB.

The answer is confirmed.

Common pitfalls

  • Subtracting the coordinates in a different order on the top and bottom of the gradient, for example y2y1x1x2\frac{y_2 - y_1}{x_1 - x_2}, which reverses the sign.
  • Getting the perpendicular gradient wrong: the negative reciprocal of 33 is 13-\frac{1}{3}, not 3-3 or 13\frac{1}{3}.
  • Forgetting to expand the bracket in yy1=m(xx1)y - y_1 = m(x - x_1), or dropping the sign when the coordinate is negative.
  • Leaving the answer as yy1=m(xx1)y - y_1 = m(x - x_1) when the question asked for y=mx+cy = mx + c or the general form.
  • Swapping which point is (x1,y1)(x_1, y_1) partway through, the gradient is the same either way, but you must stay consistent.

How a teacher helps

The step that costs the most marks is the gradient sign, students subtract xx one way and yy the other, and the whole line tilts the wrong way. In one-to-one lessons our teachers watch you set up m=y2y1x2x1m = \frac{y_2 - y_1}{x_2 - x_1} and insist you label (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) before any numbers go in, so the subtraction stays consistent top and bottom.

For perpendicular questions we pause on the negative reciprocal until it is automatic. Because SPM Add Math uses analytic marking, we also show you how a clean gradient line earns method marks even if a later arithmetic slip changes cc.

Every teacher on spmaddmath.com.my is experienced. Lessons are online and taught in English, at your own pace.

Get 1-to-1 help.

Book a Trial Class

Frequently asked questions

What form should my final answer be in?

If the question names a form, y=mx+cy = mx + c or ax+by+c=0ax + by + c = 0, give exactly that. Otherwise y=mx+cy = mx + c is the standard, always-accepted answer.

Because marking is analytic, correct working earns method marks even before the final simplification.

What if I am only given the gradient and one point?

That is enough. Substitute the gradient and the point straight into yy1=m(xx1)y - y_1 = m(x - x_1), then expand and rearrange into y=mx+cy = mx + c.

You do not need a second point when the gradient is already known.

How does a perpendicular line change the method?

Only the gradient step changes. Read the gradient m1m_1 of the given line, then use the negative reciprocal m2=1m1m_2 = -\frac{1}{m_1} as your gradient.

Everything after that, substituting a point and rearranging, is the same.

Do I still earn marks if I slip up in the arithmetic?

Yes. SPM Add Math uses analytic marking, so a correct gradient and a correctly substituted point-gradient equation earn method marks, even if a numerical slip changes the final constant.

Source:SRC-DSKP-EN

Written by the spmaddmath.com.my editorial team.· Last updated 5 September 2026

Ready to get started?

Book a Trial Classfrom RM50/hr · One-hour paid trial · Same-day reply
Book a Trial ClassOne-hour paid trial · Same-day reply