The distance between the numbers a and b on a number line is ∣b−a∣: subtract and drop the sign. A distance is never negative, and ∣b−a∣=∣a−b∣.
Example
From −3 to 5: ∣5−(−3)∣=∣8∣=8. From 5 to −3: ∣−3−5∣=∣−8∣=8, the same.
Definition
Horizontal and vertical segments
Two points on one row have the same y: the distance is ∣x2−x1∣. Two points on one column have the same x: the distance is ∣y2−y1∣. Only one coordinate changes, so the number-line rule is enough.
Example
(−4,3) and (2,3) are on one row: ∣2−(−4)∣=6. (4,−3) and (4,1) are on one column: ∣1−(−3)∣=4.
Definition
The legs dx and dy
For a slanted segment from P(x1,y1) to Q(x2,y2) call dx=x2−x1 (across) and dy=y2−y1 (up or down). They have a sign: a negative dx means Q is to the left of P. The point R(x2,y1) completes a right triangle PRQ whose legs run along the grid lines: PR=∣dx∣ and RQ=∣dy∣.
Example
From P(−3,−2) to Q(4,3): dx=4−(−3)=7 and dy=3−(−2)=5. The legs are 7 and 5.
Rule
The distance formula
The segment PQ is the hypotenuse of the right triangle PRQ, so by Pythagoras PQ2=dx2+dy2 and PQ=(x2−x1)2+(y2−y1)2. Squaring removes the signs, so the order of the points does not matter.
Example
P(−2,−2), Q(2,1): dx=4, dy=3, so PQ=42+32=25=5.
Rule
Exact value and decimal
If dx2+dy2 is not a perfect square, leave the root (n, simplified when you can: 20=25) and give a decimal only when it is asked for.
Example
(1,1) and (3,5): dx=2, dy=4, d=4+16=20=25≈4.47.
Rule
Distance from the origin
From the origin O(0,0) to P(a,b) the legs are a and b, so OP=a2+b2. This is the special case of the formula with x1=y1=0.
Example
P(−3,4): OP=(−3)2+42=9+16=25=5.
Definition
The midpoint
The midpoint M of A(x1,y1) and B(x2,y2) has the mean of the coordinates: M=(2x1+x2,2y1+y2). It is the same distance from A and from B.
Example
A(−4,−1), B(2,5): M=(2−4+2,2−1+5)=(−1,2).
Rule
An end from the midpoint
If M is the midpoint of AB and you know M and A, then B is as far from M as A is, on the other side: xB=2xM−xA and yB=2yM−yA.
Example
M(3,−1), A(−2,4): B=(2⋅3−(−2),2⋅(−1)−4)=(8,−6).
Definition
Dividing a segment: inside
A point P on the segment AB with AP:PB=m:n cuts AB into m+n equal parts and is m parts from A. Its coordinates are P=(m+nnx1+mx2,m+nny1+my2): the number next to A (m) multiplies the coordinates of B.
Example
A(−4,−3), B(5,3), AP:PB=1:2: xP=32⋅(−4)+1⋅5=−1 and yP=32⋅(−3)+1⋅3=−1, so P(−1,−1).
Rule
The fraction of the way
The same point is P=A+t(B−A) with t=m+nm: go the fraction t of the way in x and in y. For m=n we get t=21 and P is the midpoint.
Example
A(2,1), B(14,9), AP:PB=1:3: t=41, so P=(2+41⋅12,1+41⋅8)=(5,3).
Rule
Why it works: similar triangles
Draw the horizontal line through A and the vertical lines through P and B; they meet it at S and T. The right triangles ASP and ATB share the angle at A, so they are similar and AS:AT=AP:AB=m:(m+n). That is the formula, one coordinate at a time.
Example
A(−4,−3), P(−1,−1), B(5,3): AS=3 and AT=9, and 3:9=1:3, which is m:(m+n) for m:n=1:2.
Rule
Dividing a segment: outside
If P is on the line AB but outside the segment and AP:PB=m:n with m=n, then P=(n−mnx1−mx2,n−mny1−my2). The only change is the minus sign.
Example
A(−3,−2), B(1,0), AP:PB=3:1: xP=1−31⋅(−3)−3⋅1=3 and yP=1−31⋅(−2)−3⋅0=1, so P(3,1), beyond B.
Rule
Which side of the segment?
Outside, P lies beyond B when m>n (then AP is the longer part) and beyond A when m<n. Inside, P is nearer to B when m>n. For m=n there is no outside point.
Example
Outside with AP:PB=1:3: m<n, so P is beyond A. Outside with AP:PB=3:1: m>n, so P is beyond B.
Rule
The ratio from a given point
If P is on AB and you know all three points, compare the differences along one axis: AP:PB=(xP−xA):(xB−xP). The y-differences give the same ratio.
Example
A(1,2), P(4,5), B(10,11): the x-differences are 3 and 6, so AP:PB=1:2; the y-differences 3 and 6 agree.
Definition
The centroid of a triangle
The centroid G of the triangle with vertices A, B, C has the mean of the three coordinates: G=(3x1+x2+x3,3y1+y2+y3). It lies on every median and divides it 2:1 from the vertex.
Example
A(−1,−1), B(5,−1), C(2,5): G=(3−1+5+2,3−1−1+5)=(2,1). The midpoint of AB is M(2,−1), and CG=4, GM=2.
Rule
The kind of a triangle from its sides
Find AB2, BC2 and CA2 with the distance formula. Two equal squares: isosceles; three equal: equilateral. If the biggest equals the sum of the other two (a2+b2=c2), the angle opposite it is a right angle. Compare the squares, not the roots.
Example
A(1,5), B(4,2), C(7,5): AB2=18, BC2=18, CA2=36=18+18. Right-angled and isosceles, with the right angle at B.
Rule
Perimeter and area from coordinates
The perimeter is the sum of the three distances. When the triangle has a right angle, take its legs as base and height: area =21⋅b⋅h (base b, height h). Two sides along the axes make this easy.
Example
A(−2,−1), B(2,−1), C(2,2): AB=4, BC=3, AC=5, so the perimeter is 12. The right angle is at B: area =21⋅4⋅3=6.
Rule
Three points on one line
Three points A, B, C are collinear exactly when the longest of AB, BC, CA equals the sum of the other two. Compare the distances (not their squares) and keep the roots exact.
Example
A(0,−3), B(2,1), C(5,7): AB=20=25, BC=45=35, AC=125=55=AB+BC. The points are collinear.
Rule
Maps: as the crow flies and along the streets
On a map with k km per square, the straight distance (as the crow flies) is dx2+dy2⋅k. Along a grid of streets you walk the legs: (∣dx∣+∣dy∣)⋅k, which is never shorter. A real road lies in between or is longer.
Example
A(−2,−1), B(2,2), 1 square = 2 km: straight 16+9⋅2=10 km; along the streets (4+3)⋅2=14 km.
Rule
Is a home in the range of a mast?
A phone mast M reaches every point whose distance from M is at most the range r: these points fill the circle with centre M and radius r. A home H is in range when MH≤r. Squaring both sides gives the same test without a root: MH2≤r2, with MH2=dx2+dy2. Compare squares with squares.
Example
Mast M(0,0), range 5 km, 1 square =1 km. Home H1(3,2): MH2=32+22=13≤25=52, in range. Home H2(5,3): MH2=25+9=34>25, out of range.
Rule
A point equally far from two towns
A station C must be equally far from the towns A and B: CA=CB, so CA2=CB2. Write both with the distance formula. If C lies on the x-axis it is C(x,0), the x2 terms cancel and an equation of the first degree is left. The station lies on the line that cuts AB at a right angle through its midpoint.
Example
A(0,3), B(4,1), C(x,0): x2+32=(x−4)2+12, so x2+9=x2−8x+17 and 8x=8, x=1. Check: CA2=1+9=10 and CB2=9+1=10.
Rule
Latitude and longitude on a flat map
On a flat map of a small area one degree of latitude is about 111 km. One degree of longitude is about 111cos(latitude) km, because the meridians come closer towards the poles. So dy=Δlat⋅111, dx=Δlon⋅111cos(lat) and d=dx2+dy2. The result is a flat-map estimate, not the exact distance over the earth.
Example
Two places at latitude 60∘, 4 degrees of longitude apart: cos60∘=21, so d=4⋅111⋅21=222 km. Two places 3 degrees east and 4 degrees north of each other near the equator: dx=333, dy=444, d=3332+4442=555 km.
Rule
Distance, time and the length of a trip
Divide a distance by the speed to get the time: t=vd. On a trip along several straight pieces add the lengths of the pieces: AB+BC is at least AC, and equal only when B lies on the segment AC.
Example
A drone flies from A(0,0) to B(6,8) at 30 km/h: AB=62+82=10 km and t=3010 h =20 minutes.
Tip
Know the right-angled triples
If the legs are 3 and 4 (or 6 and 8, 5 and 12, 8 and 15) the distance is a whole number: 5, 10, 13, 17. Spot them before you reach for the calculator.
Example
(0,0) to (−9,12): the legs 9 and 12 are 3 times 3 and 4, so d=3⋅5=15.
Tip
Sketch first, then check the size
Plot the points on a quick sketch. The distance is at least the larger of ∣dx∣ and ∣dy∣ and at most ∣dx∣+∣dy∣. The midpoint lies between the ends and the centroid inside the triangle. An answer outside these limits is wrong.
Example
(0,0) and (3,4): d must be between 4 and 7. The answer 5 fits; 7 is the walk along the legs.
Tip
Test a conjecture
A conjecture is a guess like “the distance is ∣dx∣+∣dy∣”. Test it on an axis-parallel pair and on a slanted pair. One case that fails is enough to throw it out; cases that work are not a proof, the reason is (Pythagoras, similar triangles).
Example
“d=∣dx∣+∣dy∣” works for (0,0) and (5,0) but fails for (0,0) and (3,4): 7=5.
Tip
Four stages for a real-life problem
Work in four stages: what is given and what is wanted, which relation connects them, the work, and a check against a sketch or a second route. Say what you assumed (a flat map, a straight route): a model is only as good as its data.
Example
Mast: given M, H and r; wanted: in range or not; relation MH2≤r2; work 13≤25; check: on the sketch H1 is inside the circle.
Watch out!
Adding the legs
A common mistake is d=∣dx∣+∣dy∣. That is the length of the walk along the grid; the straight distance needs the squares and the root.
Example
(0,0) to (6,8): 6+8=14 is the walk; the distance is 36+64=10.
Watch out!
Stopping early or splitting the root
Two slips: stopping at dx2+dy2 (that is d2, not d) and writing dx2+dy2 as ∣dx∣+∣dy∣. The root of a sum is not the sum of the roots.
Example
(0,0) to (3,4): 9+16=25 is d2, so d=5. And 9+16=5, not 3+4=7.
Watch out!
Sign slips with negative numbers
Write the subtraction with brackets: x2−x1=3−(−5)=8, not 3−5. After squaring the sign does not matter, but a slip before squaring changes the number.
Example
P(−5,2), Q(3,−4): dx=3−(−5)=8 and dy=−4−2=−6, so d=64+36=10.
Watch out!
Swapping m and n
In AP:PB=m:n the point is m parts from A, so B gets the weight m: xP=m+nnx1+mx2. Writing mx1+nx2 gives the point for the ratio n:m, the mirror image. Check: when m>n, P must be nearer to B.
Example
A(0,0), B(6,0), AP:PB=1:2: xP=32⋅0+1⋅6=2, nearer to A as it should be. Swapped it would give 4.
Watch out!
A distance against a squared distance
MH2 is a squared distance and the range r is a distance. Compare MH2 with r2, or MH with r, never MH2 with r.
Example
MH2=13 and r=5: 13>5 would say “out of range”, but the right test is 13≤25: in range.
Watch out!
Degrees are not kilometres
A difference in degrees must be multiplied by 111 km per degree, and a difference in longitude also by cos(latitude). Using dx and dy in degrees as if they were km gives a distance that is far too small.
Example
3 degrees of latitude are 3⋅111=333 km, not 3 km.
Special case
Special cases
Equal points: d=0. Same row or column: one leg is 0 and the formula gives ∣x2−x1∣ or ∣y2−y1∣. With m=n the inside point is the midpoint and the outside point does not exist, because n−m=0.
Example
(2,5) and (2,−1): dx=0, so d=0+36=6. For AP:PB=2:2 the point is the midpoint.
Exercises
Find the distance between A(−3,2) and B(4,2), and between C(5,−1) and D(5,6). Easy
Show solution
A and B have the same y: AB=∣4−(−3)∣=7.
C and D have the same x: CD=∣6−(−1)∣=7.
Answer → AB=7 and CD=7
Check: count the grid squares between the points: 7 in both cases.
Find the distance between P(−1,−2) and Q(2,2). Easy
Show solution
The legs: dx=2−(−1)=3 and dy=2−(−2)=4.
Pythagoras: PQ2=32+42=9+16=25.
So PQ=25=5.
Answer → PQ=5
Check: PQ is longer than each leg (3 and 4) and shorter than 3+4=7.
Find the midpoint of A(−4,6) and B(8,−2). Easy
Show solution
xM=2−4+8=2.
yM=26+(−2)=2.
Answer → M(2,2)
Check: from A to M you go 6 across and 4 down, and from M to B again 6 across and 4 down.
How far is the point (−6,8) from the origin? Easy
Show solution
From (0,0) the legs are −6 and 8.
d=(−6)2+82=36+64=100=10.
Answer → 10
Check: 6 and 8 are twice 3 and 4, so the distance is twice 5.
A phone mast stands at M(0,0) and reaches 5 km (1 square = 1 km). Is a home at H(3,2) in range? Easy
Show solution
dx=3 and dy=2, so MH2=32+22=13.
r2=52=25 and 13≤25.
Answer → yes, in range (MH2=13<25)
Check: on the figure the home is inside the circle of the range.
A drone flies from A(0,0) to B(6,8) (1 square = 1 km) at 30 km/h. How many minutes does the flight take? Easy
Show solution
AB=62+82=100=10 km.
t=3010 h =31 h =20 minutes.
Answer → 20 minutes
Check: 30 km/h is 0.5 km per minute, and 10÷0.5=20.
Find the exact distance between A(1,−2) and B(4,4) and give it to 2 decimal places. Medium
Show solution
dx=4−1=3 and dy=4−(−2)=6.
d2=9+36=45.
d=45=35≈6.71.
Answer → 35≈6.71
Check: the distance must be between 6 (the larger leg) and 9 (the sum of the legs): 6.71 fits.
M(3,−1) is the midpoint of AB and A is (−2,4). Find B. Medium
Show solution
B is as far from M as A is, on the other side: xB=2⋅3−(−2)=8.
yB=2⋅(−1)−4=−6.
Answer → B(8,−6)
Check: the midpoint of (−2,4) and (8,−6) is (2−2+8,24−6)=(3,−1).
P is on the segment AB with A(−2,1), B(7,10) and AP:PB=1:2. Find P. Medium
Show solution
Here m=1, n=2 and m+n=3.
xP=32⋅(−2)+1⋅7=33=1.
yP=32⋅1+1⋅10=312=4.
Answer → P(1,4)
Check: P is 31 of the way from A: −2+31⋅9=1 and 1+31⋅9=4.
A plot has corners A(−2,−1), B(2,−1) and C(2,2) (1 unit = 1 m). Find its perimeter and its area. Medium
Show solution
AB=∣2−(−2)∣=4 and BC=∣2−(−1)∣=3 lie along the grid lines.
AC=42+32=25=5, so the perimeter is 4+3+5=12 m.
The right angle is at B: area =21⋅4⋅3=6 m².
Answer → perimeter 12 m, area 6 m²
Check: 42+32=16+9=25=52, so the angle at B really is right.
Find the centroid of the triangle with vertices A(−3,2), B(6,5) and C(0,−1). Medium
Show solution
The centroid has the mean of the three coordinates.
xG=3−3+6+0=1.
yG=32+5+(−1)=36=2.
Answer → G(1,2)
Check: G must lie inside the triangle; (1,2) is between the vertices in both coordinates.
A station C(x,0) on a straight railway (the x-axis) must be equally far from the towns A(1,4) and B(5,2). Find x. Medium
Show solution
CA2=CB2: (x−1)2+42=(x−5)2+22.
x2−2x+17=x2−10x+29, so 8x=12 and x=23.
Answer → x=23, so C(23,0)
Check: CA2=0.25+16=16.25 and CB2=12.25+4=16.25.
On a flat map one degree is 111 km in both directions. Place B is 3 degrees east and 4 degrees north of place A. How far apart are they, in km? Medium
Show solution
dx=3⋅111=333 km and dy=4⋅111=444 km.
d=3332+4442=11132+42=111⋅5=555 km.
Answer → 555 km
Check: it is the 3-4-5 triangle scaled by 111.
Two places at latitude 60∘ are 6 degrees of longitude apart. How far apart are they, in km, on a flat map? Medium
Show solution
One degree of longitude is 111cos60∘=111⋅21 km.
d=6⋅111⋅21=333 km.
Answer → 333 km
Check: at the equator it would be 6⋅111=666 km; here it is half of that.
P is on the line AB, outside the segment, with A(2,−1), B(6,1) and AP:PB=1:3. Find P. Hard
Show solution
Outside: m=1<n=3, so P is beyond A.
xP=n−mnx1−mx2=3−13⋅2−1⋅6=20=0.
yP=3−13⋅(−1)−1⋅1=2−4=−2.
Answer → P(0,−2), beyond A
Check: A to P is (−2,−1) and P to B is (6,3): three times as long, in the opposite direction.
A point C(x,0) on the x-axis is equally far from A(1,3) and B(5,1). Find x. Hard
Show solution
Write the squares: CA2=(x−1)2+32 and CB2=(x−5)2+12.
Set them equal: x2−2x+10=x2−10x+26.
The x2 cancels: 8x=16, so x=2.
Answer → x=2, so C(2,0)
Check: CA2=1+9=10 and CB2=9+1=10.
Which kind of triangle has the vertices A(−3,1), B(0,−2) and C(3,1)? Find its perimeter and area. Hard
Show solution
The squares of the sides: AB2=32+32=18, BC2=32+32=18, CA2=62+02=36.
Two equal squares: isosceles. And 18+18=36: right-angled, with the right angle at B.
Perimeter: 32+32+6=62+6≈14.49.
Area: 21⋅AB⋅BC=21⋅32⋅32=9.
Answer → right-angled isosceles, perimeter 62+6≈14.49, area 9
Check: the base CA=6 and the height from B is 3 (from y=−2 up to y=1): area 21⋅6⋅3=9.
Are A(0,−3), B(2,1) and C(5,7) on one line? If so, in which ratio does B divide AC? Hard
The longest is AC=55 and 25+35=55: equal, so the points are on one line.
B lies between A and C with AB:BC=25:35=2:3.
Answer → yes, collinear, AB:BC=2:3
Check with the x-differences: 2−0=2 and 5−2=3, so 2:3; the y-differences 4 and 6 give 2:3 too.
Two towns are at A(0,0) and B(12,9) (coordinates in km). Two friends meet at P on the straight road, with AP:PB=2:3. Find P and the distance from A to P. Hard
Show solution
Here m=2, n=3, so P=(53⋅0+2⋅12,53⋅0+2⋅9)=(524,518)=(4.8;3.6).
The whole road: AB=122+92=225=15 km.
AP is 52 of the road: 52⋅15=6 km.
Answer → P(4.8;3.6) and AP=6 km
Check: AP=4.82+3.62=36=6 km and PB=15−6=9 km, so AP:PB=6:9=2:3.
A courier goes from A(−2,−1) to B(4,7) and then to C(16,12) in straight lines (1 square = 1 km), at 46 km/h. How many minutes does the whole trip take? Hard
Show solution
AB: dx=6, dy=8, so AB=10 km.
BC: dx=12, dy=5, so BC=122+52=13 km.
The trip is 10+13=23 km, so t=4623 h =30 minutes.
Answer → 30 minutes
Check: both legs use the triples 6-8-10 and 5-12-13; 46 km/h is 23 km in half an hour.
A mast at M(0,0) reaches 10 km. A home at H(x,6) with x>0 is exactly on the edge of the range. Find x. Is a home at K(7,7) in range? Hard
Show solution
On the edge MH=r: x2+62=102, so x2=64 and x=8.
K: MK2=72+72=98 and r2=100.
98<100, so K is inside.
Answer → x=8; yes, K is in range
Check: 82+62=100=102; the right-triangle 6-8-10.
Interactive applications for this topic
Free applications open with a free student account. Teachers can use all applications in a live lesson.