Skip to content

Straight lines in coordinate geometry

A straight line has a constant gradient. Its equation records two pieces of information: how steeply the line rises or falls, and where it is positioned in the coordinate plane.

Straight-line methods support later work on circles, tangents, vectors, calculus and mathematical modelling. The formulae are short, but accurate reasoning about signs, vertical lines and context matters.

You should be able to:

  • substitute signed numbers into an expression
  • rearrange linear equations
  • solve simultaneous linear equations
  • use Pythagoras’ theorem

For distinct points (x1,y1)(x_1,y_1) and (x2,y2)(x_2,y_2) with x1x2x_1\ne x_2, the gradient is

m=y2y1x2x1.\boxed{m=\frac{y_2-y_1}{x_2-x_1}}.

Gradient measures change in yy per unit change in xx:

m=vertical changehorizontal change.m=\frac{\text{vertical change}}{\text{horizontal change}}.

Use the same subtraction order in the numerator and denominator. Reversing both differences gives the same result; reversing only one changes the sign incorrectly.

Find the gradient of the line through A(3,5)A(-3,5) and B(7,1)B(7,-1).

m=157(3)=610=35.m=\frac{-1-5}{7-(-3)}=\frac{-6}{10}=-\frac35.

The negative sign agrees with the geometry: as xx increases from 3-3 to 77, yy decreases.

If x1=x2x_1=x_2, the denominator is zero and the line is vertical. Its gradient is undefined and its equation has the form

x=k.\boxed{x=k}.

A horizontal line has gradient 00 and equation y=ky=k.

Different forms make different information visible.

y=mx+c\boxed{y=mx+c}

Here mm is the gradient and cc is the yy intercept, the value of yy when x=0x=0.

A line of gradient mm through (x1,y1)(x_1,y_1) is

yy1=m(xx1).\boxed{y-y_1=m(x-x_1)}.

This is usually the quickest form when a point and gradient are known. It also avoids finding cc as a separate step.

Ax+By+C=0\boxed{Ax+By+C=0}

where AA and BB are not both zero. If B0B\ne0, rearranging gives

y=ABxCB,y=-\frac ABx-\frac CB,

so the gradient is A/B-A/B. General form also includes vertical lines, for which B=0B=0.

All three forms can describe the same line. For example,

y4=2(x1),y-4=2(x-1),

y=2x+2,y=2x+2,

and

2xy+2=02x-y+2=0

are equivalent.

Find the equation of the line through (4,2)(4,-2) with gradient 3/23/2.

Substitute into point-gradient form:

y(2)=32(x4).y-(-2)=\frac32(x-4).

Therefore

y+2=32(x4).\boxed{y+2=\frac32(x-4)}.

If gradient-intercept form is required,

y=32x8.y=\frac32x-8.

Check the point: substituting x=4x=4 gives y=2y=-2.

Find the equation through P(2,1)P(-2,1) and Q(4,10)Q(4,10).

First find the gradient:

m=1014(2)=96=32.m=\frac{10-1}{4-(-2)}=\frac96=\frac32.

Use either point:

y1=32(x+2).y-1=\frac32(x+2).

Hence

y=32x+4.\boxed{y=\frac32x+4}.

Substituting both original points is a quick final check.

Distinct parallel non-vertical lines have equal gradients:

m1=m2.\boxed{m_1=m_2}.

Vertical lines are also parallel to one another, although their gradients are undefined.

Find the line through (3,5)(3,-5) parallel to

4x2y+7=0.4x-2y+7=0.

Rearrange the given line:

2y=4x7,-2y=-4x-7,

y=2x+72.y=2x+\frac72.

Its gradient is 22. The required line is

y+5=2(x3),\boxed{y+5=2(x-3)},

or y=2x11y=2x-11.

Alternatively, a parallel line in general form must have matching xx and yy coefficients up to a common factor, so it can be written 4x2y+C=04x-2y+C=0. Substituting (3,5)(3,-5) gives C=22C=-22.

For two non-vertical, non-horizontal perpendicular lines,

m1m2=1.\boxed{m_1m_2=-1}.

Thus the perpendicular gradient to mm is

1m.\boxed{-\frac1m}.

This is the negative reciprocal. Both operations matter.

Special cases must be handled geometrically:

  • a horizontal line is perpendicular to a vertical line
  • a vertical line is perpendicular to a horizontal line

Find the perpendicular bisector of the segment joining A(1,2)A(-1,2) and B(5,6)B(5,6).

The midpoint is

M=(1+52,2+62)=(2,4).M=\left(\frac{-1+5}{2},\frac{2+6}{2}\right)=(2,4).

The gradient of ABAB is

mAB=625(1)=23.m_{AB}=\frac{6-2}{5-(-1)}=\frac23.

The perpendicular gradient is 3/2-3/2. Therefore the perpendicular bisector is

y4=32(x2).\boxed{y-4=-\frac32(x-2)}.

This construction is important for finding the centre of a circle through known points.

At an intersection, the coordinates satisfy both line equations. Solve the equations simultaneously.

Find where

2x+y=112x+y=11

and

x2y=8x-2y=-8

intersect.

From the first equation,

y=112x.y=11-2x.

Substitute into the second:

x2(112x)=8,x-2(11-2x)=-8,

5x22=8,5x-22=-8,

x=145.x=\frac{14}{5}.

Then

y=112(145)=275.y=11-2\left(\frac{14}{5}\right)=\frac{27}{5}.

The intersection is

(145,275).\boxed{\left(\frac{14}{5},\frac{27}{5}\right)}.

Two distinct parallel lines have no intersection. Equivalent equations describe the same line and therefore have infinitely many common points.

The distance between (x1,y1)(x_1,y_1) and (x2,y2)(x_2,y_2) follows from Pythagoras:

d=(x2x1)2+(y2y1)2.\boxed{d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}}.

The midpoint is

M=(x1+x22,y1+y22).\boxed{M=\left(\frac{x_1+x_2}{2},\frac{y_1+y_2}{2}\right)}.

For A(4,1)A(-4,1) and B(2,9)B(2,9),

=\sqrt{6^2+8^2}=10,$$ and $$M=\left(\frac{-4+2}{2},\frac{1+9}{2}\right)=(-1,5).$$ Distance is never negative. Squaring coordinate differences ensures their signs do not affect the length. ## Distance from a point to a line For the line $$Ax+By+C=0,$$ the perpendicular distance from $(x_0,y_0)$ is $$\boxed{d=\frac{|Ax_0+By_0+C|}{\sqrt{A^2+B^2}}}.$$ The absolute value is essential because distance is non-negative. The denominator accounts for the scale of the equation: multiplying the whole line equation by a constant must not change the geometric distance. ### Example 8: point-to-line distance Find the distance from $P(3,-1)$ to $$4x-3y-6=0.$$ Substitute into the formula: $$d=\frac{|4(3)-3(-1)-6|}{\sqrt{4^2+(-3)^2}} =\frac{|9|}{5} =\boxed{\frac95}.$$ This formula is particularly useful for distances from circle centres to lines and for deciding whether a line meets a circle. ## Straight-line models A model of the form $$y=mx+c$$ assumes a constant rate of change. In context: - $m$ is the predicted change in $y$ for each one-unit increase in $x$ - $c$ is the predicted value of $y$ when $x=0$ The units belong in the interpretation. If $x$ is time in hours and $y$ is volume in litres, then $m$ is measured in litres per hour. ### Example 9: interpret a model The temperature $T$ in degrees Celsius of a cooling liquid is modelled for the first ten minutes by $$T=84-3.6t,$$ where $t$ is time in minutes. The intercept $84$ predicts an initial temperature of $84^\circ\text{C}$. The gradient $-3.6$ predicts that the temperature falls by $3.6^\circ\text{C}$ per minute. At $t=7$, $$T=84-3.6(7)=58.8,$$ so the model predicts $58.8^\circ\text{C}$. Setting $T=0$ gives $t=84/3.6\approx23.3$ minutes, but this lies outside the stated ten-minute interval. It would also be physically unrealistic for a simple cooling process to continue linearly without limit. ### Limitations of a linear model Before using or extrapolating a straight-line model, ask: - Is a constant rate plausible throughout the interval? - Does the prediction remain within a physically meaningful range? - Is the input inside the range from which the model was built? - Does the intercept have a meaningful interpretation in context? - Could another variable be affecting the relationship? A good calculation can still produce a poor prediction if the model's assumptions are unsuitable. ## Common mistakes - Mixing subtraction orders in the gradient formula. - Reading $c$ as the $x$ intercept in $y=mx+c$. - Assuming two lines are parallel because their intercepts are equal. - Taking only the reciprocal, rather than the negative reciprocal, for a perpendicular gradient. - Trying to assign a finite gradient to a vertical line. - Finding the midpoint by subtracting coordinates instead of averaging them. - Dropping the absolute value in the point-to-line distance formula. - Giving a model gradient without its contextual units. - Extrapolating a model far beyond its stated domain without comment. ## Check your understanding 1. Find the equation of the line through $(-2,5)$ and $(4,-7)$. 2. Find the line through $(1,3)$ perpendicular to $3x+2y=8$. 3. Find the intersection of $y=3x-4$ and $2x+y=11$. 4. Find the perpendicular bisector of the segment joining $(2,-1)$ and $(8,3)$. 5. Find the distance from $(-2,4)$ to $5x+12y-9=0$. 6. A taxi fare is modelled by $C=3.20+1.85d$, where $C$ is cost in pounds and $d$ is distance in miles. Interpret both constants and predict the fare for $7$ miles. <details> <summary>Answers</summary> ### 1 $$m=\frac{-7-5}{4-(-2)}=-2.$$ Using $(-2,5)$, $$\boxed{y-5=-2(x+2)},$$ or $y=-2x+1$. ### 2 Rearranging the given line gives $y=-3x/2+4$, so its gradient is $-3/2$. The perpendicular gradient is $2/3$: $$\boxed{y-3=\frac23(x-1)}.$$ ### 3 Substitute $y=3x-4$ into $2x+y=11$: $$2x+3x-4=11,$$ so $x=3$ and $y=5$. The intersection is $\boxed{(3,5)}$. ### 4 The midpoint is $(5,1)$. The segment gradient is $4/6=2/3$, so the perpendicular gradient is $-3/2$: $$\boxed{y-1=-\frac32(x-5)}.$$ ### 5 $$d=\frac{|5(-2)+12(4)-9|}{\sqrt{5^2+12^2}} =\frac{29}{13}.$$ ### 6 The fixed charge is £3.20 and the cost increases by £1.85 per mile. For $d=7$, $$C=3.20+1.85(7)=\boxed{£16.15}.$$ </details> ## What to learn next Continue to [circles](/learn/coordinate-geometry/circles/) to combine line equations with radii, chords and tangents. Then study [parametric equations](/learn/coordinate-geometry/parametric-equations/) to represent curves and motion using a third variable.