Coordinate Geometry
Coordinate Geometry
In this unit we find the gradient of a straight line segment, and the relationships between the
gradients of parallel lines and of perpendicular lines.
In order to master the techniques explained here it is vital that you undertake plenty of practice
exercises so that they become second nature.
After reading this text, and/or viewing the video tutorial on this topic, you should be able to:
Contents
1. The gradient of a line 2
2. Parallel lines 5
3. Perpendicular lines 6
y
D(2, 5)
C(2, 3)
A(1, 1) B(2, 1)
1 2 x
Figure 1.
On the segment AD, y changes from 1 to 5 as x changes from 1 to 2. So the change in y is 4,
and the change in x is 1. The relative change is
change in y 5−1 4
= = =4
change in x 2−1 1
On the segment AC, y changes from 1 to 3 as x changes from 1 to 2. So the change in y is 2,
and the change in x is 1. The relative change is
change in y 3−1 2
= = =2
change in x 2−1 1
On the segment AB, y does not change as x changes from 1 to 2. So the change in y is 0, and
the change in x is 1. The relative change is
change in y 1−1 0
= = =0
change in x 2−1 1
change in y
The relative change, is the gradient of the line segment. By defining the gradient in
change in x
this way we see that this is consistent with our ideas of steepness - lines which are steeper have
a larger gradient than lines which are less steep. Lines which are horizontal have zero gradient.
In the general case, if we take two points A(x1 , y1 ) and B(x2 , y2 ) (Figure 2) then we can work
out the gradient using the same method as before, by finding the point C and then finding the
lengths AC and BC.
A(x1, y1) C
Figure 2.
Here, the point C is given by (x2 , y1 ). So the length AC is x2 − x1 , and the length BC is y2 − y1 .
Therefore the gradient of AB is
BC y2 − y1
= .
AC x2 − x1
It is a common convention that the gradient of a line is written as m, so we can write m = y2 −y1
x2 −x1
.
Key Point
The gradient, m, of the line segment joining the points A(x1 , y1) and B(x2 , y2) is given by
y2 − y1
m= .
x2 − x1
We can also think of this another way. Remember that, in the right-angled triangle shown in
Figure 3, tan θ equals the opposite over the adjacent, or the change in y over the change in x
as we move from the beginning to the end of the hypotenuse.
y
opposite
θ
adjacent
θ
x
Figure 3.
Key Point
The gradient of a line is equal to the tangent of the angle that the line makes with the horizontal.
This is also the tangent of the angle the line makes with the x axis.
Example
Suppose A is the point (3, 4) and B is the point (8, 14). Then the gradient m is
14 − 4
m =
8−3
10
=
5
= 2.
Example
Suppose A is the point (0, 4) and B is the point (5, 0). Then the gradient m is
0−4
m =
5−0
4
= − .
5
Note that the gradient is negative. What does that mean? If we draw a sketch then we can
see that the line slopes in a different direction, and the angle made by the line with the x-axis is
obtuse.
y
A(0, 4)
θ
x
B(5, 0)
Figure 4.
So we can compare the different cases, where the gradient is positive, negative, or even zero.
Take any general line, and let θ be the angle it makes with the x-axis.
y y y
θ = 0
θ acute θ obtuse
x x x
Figure 5.
Exercise
1. Find the gradient of the line segment joining each pair of points:
(a) (1, 4) and (5, 7); (b) (2, 0) and (4, 0); (c) (5, −1) and (3, 2)
(d) (−1, 2) and (−4, −1);
2. Parallel lines
We can apply our knowledge of gradients to the case of parallel lines. If l1 and l2 are two parallel
lines, then the angles θ1 and θ2 that they make with the x-axis are corresponding angles, and so
must be equal. Therefore parallel lines must have the same gradient. And lines with the same
gradient must be parallel.
θ θ
x
Figure 6.
Example
Suppose we take the four points A(1, 1), B(4, 2), C(1, −2) and D(−2, −3). Can we show that
AB is parallel to CD?
We shall let m1 be the gradient of AB, and let m2 be the gradient of CD. Then
2−1 1
m1 = =
4−1 3
and
−3 − (−2) −1 1
m2 = = = ,
−2 − 1 −3 3
so the gradients are the same. Therefore the lines AB and CD are parallel.
3. Perpendicular lines
But what about perpendicular lines? Is there a relationship between their gradients?
If we take the point P (a, b) and rotate the line OP anti-clockwise through a right angle about
the origin, then P moves to a new point Q. We can find the co-ordinates of Q. To reach P we
went along by a, and up by b. So to reach Q we must go up by a, and then to the left a distance
b. Therefore Q must be the point (−b, a).
b P(a, b)
Q(-b, a)
a b
a
O
Figure 7.
Key Point
Suppose that the lines l1 , l2 have gradients m1 and m2 . If the lines are perpendicular then
m1 m2 = −1. Conversely, we can use this relationship between m1 and m2 to decide whether or
not two lines are perpendicular.
Example
Suppose we have three points A(1, 2), B(3, 4) and C(0, 3). We can use this formula to show
that AB is perpendicular to CA.
y
B(3, 4)
C(0, 3)
A(1, 2)
Figure 8.
Let m1 be the gradient of AB and m2 be the gradient of CA. Then
4−2 2
m1 = = =1
3−1 2
and
2−3
m2 = = −1 ,
1−0
so m1 m2 = 1 × (−1) = −1. Therefore AB is perpendicular to CA.
Answers
1.
(a) 0.75, (b) 0, (c) −1.5, (d) 1.
2.
(a) Both lines have gradient 3 so are parallel.
(b) a = 13.
(c) AB has gradient −2, BC has gradient 0.5, the product is −1 so the lines are perpendicular.
(d) k = 15.
In this unit we use a system of co-ordinates to find various properties of the straight line between
two points. We find the distance between the two points and the mid-point of the line joining
the two points.
In order to master the techniques explained here it is vital that you undertake plenty of practice
exercises so that they become second nature.
After reading this text, and/or viewing the video tutorial on this topic, you should be able to:
• find the co-ordinates of the mid-point of the line joining two points;
Contents
1. Introduction 2
2. The distance between two points 3
3. The midpoint of the line joining two points 5
A(x, y)
y
x
O x
y
3 C B
2 A
1
D
-3 -2 -1 1 2 3 x
-1
-2 F
E -3
F
E D
3
A
B
−3 3
−3 G C
H
Figure 3.
A(1, 3) C
Now we can use this method whenever we have a problem like this, but it will be easier if we can
derive a general formula to use instead.
Let us take two general points A(x1 , y1 ) and B(x2 , y2) as shown in Figure 5. To find the distance
between them, we need to form a right angled triangle ABC such that AB is the hypotenuse.
When we do this, C will be the point (x2 , y1 )
y
B(x2, y2)
A(x1, y1) C
AB 2 = AC 2 + BC 2 ,
AB 2 = (x2 − x1 )2 + (y2 − y1 )2 .
Taking the square root of both sides then gives us the formula
p
AB = (x2 − x1 )2 + (y2 − y1 )2 .
In short, the distance between any two points is the square root of the sum of the x difference
squared and the y difference squared.
Key Point
The length of the line segment joining the points A(x1 , y1) and B(x2 , y2) is given by
p
AB = (x2 − x1 )2 + (y2 − y1 )2 .
√
So the distance between the points A and B is 58 units.
Exercise
2. Find the distance between each pair of points given below:
(a) (1, 4) and (5, 7); (b) (2, 0) and (4, 0); (c) (5, −1) and (3, 2)
(d) (−1, 2) and (−4, −1); (e) (1, 7) and (1, −4).
y
B(4, 5)
P
A(2, 3)
P
D
A(2, 3)
C
Figure 7.
Therefore the x coordinate is 12 (2 + 4) = 3 and the y coordinate is 21 (3 + 5) = 4. We conclude
that P has coordinates (3, 4).
Now we can derive a general formula for the midpoint of the line shown in Figure 8.
y
B(x2, y2)
P
A(x1, y1)
Figure 8.
In the general case, if the two points
are A(x1 , y1) and B(x2 , y2 ) then the midpoint P must be
1 1
equal to 2 (x1 + x2 ), 2 (y1 + y2 ) .
Key Point
The midpoint P of the two points A(x1 , y1 ) and B(x2 , y2 ) is given by
P 12 (x1 + x2 ), 21 (y1 + y2 ) .
Exercise
3. Find the mid-point of the line segment joining each pair of points in Exercise 2.
Answers
1.
A(2, 2), B(−2, 0), C(2, −3), D(0, 4), E(−3, 4), F (1, 5), G(0, −3), H(−4, −4).
2.
√ √ √
(a) 5, (b) 2, (c) 13, (d) 18 = 3 2, (e) 11.
3.
(a) (3, 5.5), (b) (3, 0), (c) (4, 0.5), (d) (−2.5, 0.5), (e) (1, 1.5).
In this unit we find the equation of a straight line, when we are given some information about
the line. The information could be the value of its gradient, together with the co-ordinates of a
point on the line. Alternatively, the information might be the co-ordinates of two different points
on the line. There are several different ways of expressing the final equation, and some are more
general than others.
In order to master the techniques explained here it is vital that you undertake plenty of practice
exercises so that they become second nature.
After reading this text, and/or viewing the video tutorial on this topic, you should be able to:
• find the equation of a straight line, given its gradient and its intercept on the y-axis;
• find the equation of a straight line, given its gradient and one point lying on it;
• find the equation of a straight line given two points lying on it;
• give the equation of a straight line in either of the forms y = mx + c or ax + by + c = 0.
Contents
1. Introduction 2
2. The equation of a line through the origin with a given gradient 2
3. The y-intercept of a line 4
4. The equation of a straight line with a given gradient, passing 7
through a given point
5. The equation of a straight line through two given points 8
6. The most general equation of a straight line 10
y
x y
0 2
1 3
2 4
3 5
There are many more points on the line, but we have enough now to see a pattern. If we take
any x value and add 2, we get the corresponding y value: 0 + 2 = 2, 1 + 2 = 3, 2 + 2 = 4, and
so on. There is a fixed relationship between the x and y co-ordinates of any point on the line,
and the equation y = x + 2 is always true for points on the line. We can label the line using this
equation.
y
y = x: x y
0 0
1 1
2 2
y = x
3 3
We can find the gradient of the line using the formula for gradients,
y2 − y1
m= ,
x2 − x1
y
y = 2x: x y y = 2x
0 0
1 2
2 4 y = x
If we calculate the gradient of the line y = 2x using the first two sets of values in the table, we
obtain
2−0
m= =2
1−0
so that the gradient of this line is 2.
Now take the equation y = 3x. This also represents a straight line, and for all the points on the
line each y value is three times the corresponding x value. So the line will contain points in the
following list.
y y = 3x
y = 3x: x y y = 2x
0 0
1 3
2 6 y = x
If we calculate the gradient of the line y = 3x using the first two sets of values in the table, we
obtain
3−0
m= =3
1−0
so that the gradient of this line is 3.
Key Point
The equation of a straight line with gradient m passing through the origin is given by
y = mx .
y
y = 2x + 1: x y y = 2x + 1
0 1
1 3
2 5
Notice that when x = 0 the value of y is 1. So this line cuts the y-axis at y = 1.
y = 2x − 1: x y y = 2x - 1
-1 -3
0 -1
1 1
x
-1
Key Point
The equation of a straight line with gradient m and intercept c on the y-axis is
y = mx + c .
3y − 2x = 6 ,
3y = 2x + 6 ,
y = 32 x + 2 .
2
So now the equation is in its standard form, and we can see that the gradient is 3
and the
intercept value on the y-axis is 2.
1
We can also work backwards. Suppose we know that a line has a gradient of 5
and has a vertical
intercept at y = 1. What would its equation be?
To find the equation we just substitute the correct values into the general formula y = mx + c.
Here, m is 51 and c is 1, so the equation is y = 15 x + 1. If we want to remove the fraction, we
can also give the equation in the form 5y = x + 5, or 5y − x − 5 = 0.
Exercises
1. Determine the gradient and y-intercept for each of the straight lines in the table below.
Equation Gradient y-intercept
y = 3x + 2
y = 5x − 2
y = −2x + 4
y = 12x
y = 12 x − 2
3
2y − 10x = 8
x+y+1= 0
2. Find the equation of the lines described below (give the equation in the form y = mx + c):
(a) gradient 5, y-intercept 3; (b) gradient −2, y-intercept −1;
(c) gradient 3, passing through the origin; (d) gradient 31 passing through (0, 1);
(e) gradient − 34 , y-intercept 12 .
Key Point
The equation of a straight line with gradient m, passing through the point (x1 , y1), is
y − y1 = m(x − x1 ) .
As before, it will be useful to find a general formula that can be used for examples of this kind.
So suppose the general line passes through two points A(x1 , y1) and B(x2 , y2 ). We shall let a
general point on the line be P (x, y).
y
B(x2, y2)
P(x, y)
A(x1, y1)
Key Point
The equation of a straight line passing through the two points (x1 , y1 ) and (x2 , y2 ) is
y − y1 x − x1
= .
y2 − y1 x2 − x1
Now we can use this formula for an example. Suppose that we want to find the equation of the
straight line which passes through the two points (1, −2) and (−3, 0). We just substitute into
the formula, and rearrange. The various steps are
y − (−2) x−1
=
0 − (−2) −3 − 1
y+2 x−1
=
2 −4
x−1
y+2 =
−2
= − 21 (x − 1)
−2y − 4 = x − 1
−2y = x + 3
y = − 21 x − 32 .
Exercise
4. Find the equation of the lines described below (give the equation in the form y = mx + c):
(a) passing through (4, 6) and (8, 26), (b) passing through (1, 1) and (4, −8),
(c) passing through (3, 4) and (5, 4), (d) passing through (0, 2) and (4, 0),
(e) passing through (−2, 3) and (2, −5).
by + c = 0 ax + c = 0
x x
Key Point
The most general equation of a straight line is
ax + by + c = 0 .
Answers
1.
Equation Gradient y-intercept
y = 3x + 2 3 2
y = 5x − 2 5 -2
y = −2x + 4 -2 4
y = 12x 12 0
y = 21 x − 2
3
1
2
− 32
2y − 10x = 8 5 4
x+y+1= 0 −1 −1
2.
(a) y = 5x + 3, (b) y = −2x − 1, (c) y = 3x, (d) y = 13 x + 1, (e) y = − 43 x + 21 .
3.
(a) y = 3x + 1, (b) y = −2x + 4, (c) y = 52 x − 3, (d) y = 2, (e) y = −x.
4.
(a) y = 5x − 14, (b) y = −3x + 4, (c) y = 4, (d) y = − 21 x + 2, (e) y = −2x − 1.
5.
(a) 2x + y + 1 = 0, (b) 3x + 4y − 2 = 0, (c) 2x − 5y − 15 = 0, (d) 3x + y − 4 = 0,
(e) x + 2y − 4 = 0, (f) 2x + y + 1 = 0, (g) x − 3 = 0, (h) x = 0.