# Distance between points on a number line

## Real number line

To recall, real numbers consist of integers, fractions, rational and irrational numbers which we can represent on the real number line. When we move a positive direction on the number line it is almost always moving up or two the right, when we move in a negative direction it is almost always to the left.

On the number line, if we move from x = a to x = b then distance moved is b - a. This change of x is symbolized by Δx.

This symbol, (delta) Δ is what we use to symbolize a change in something. So,

For moving from x = a to x = b, the change in x, a to b is represented like,

Δx = b - a

If x = b is a bigger value than x = a, then Δx = b - a will be positive, meaning that the move from a to b is in a positive direction.

If x = b is a smaller value than x = a, then Δx = b - a will be negative, meaning that the move from a to b is in a negative direction.

If x = b is the same as x = a, then Δx = b - a will be zero, meaning that there was no movement of the points.

We also use Δ when representing the distance between two points a and b, for this we take the absolute value of Δ, or |Δ|, meaning strictly the positive value of the number. ( |-3| = 3 )

So:

## Distance between points on a number line

DEFINITION

dist(a, b) = b - a if b ≥ a or a - b if b > a

Or, using our absolute value (the positive value),

dist(a, b) = |Δx| = |b - a| = (Δ x)2

## Midpoint on a number line

DEFINITION

The Midpoint is the point halfway between two points, we calculate this by,

M =
a + b
2

Question: Find the distance and the midpoint of the points x = -1 and x = 7,

Recall our definition, the distance between two points, a and b, on a number line is,

dist(a, b) = |Δx| = |b - a| = (Δ x)2

We want to know how far away x = -1 is from x = 7,

[if we just calculated Δ x then that would give us the direction (if it was positive or negative) as well as the distance, which we don't want.]

For this we want the absolute value of Δ x, that is, the positive value of Δ x.

So,

dist(-1, 7) = |delta x| = |7 - (-1)| = |8| = 8

So the distance is 8

For the Midpoint,

M =
a + b
2
M =
-1 + 7
2
M =
6
2

M = 3

So the midpoint between x = -1 and x = 7 is x = 3

## The Cartesian Plane

A Cartesian plane is defined by two perpendicular number lines: the x-axis, which is horizontal, and the y-axis, which is vertical. Using these axes, we can describe any point in the plane using an ordered pair of numbers, usually x and y, said like (x, y). A Cartesian plane is thought of as two dimensional.

If we have to points, A at (x1, y1) and B at (x2, y2) on a Cartesian plane and we want to calculate the distance between them, we approach it the same way we would when calculating two points on a number line, except we have to account for the fact we have two dimensions rather than one.

## Distance between points on a Cartesian Plane

The horizontal direction of the change in x-values is:

Δ x = x2 - x1

The vertical direction of the change in y-values is

Δ y = y2 - y1

For our distance between A and B recall the Pythagorean theorem of,

a2 + b2 = c 2,

In this case, the c value from the theorem is equivalent to dist(A, B), and the Δ x and Δ y are equivalent to the a and b value from the theorem,

(dist(A, B))2 = (Δ x)2 + (Δ y)2

DEFINITION

dist(A, B) = (Δ x)2 + (Δ y)2

## Midpoint between points on a Cartesian Plane

DEFINITION

The Midpoint, M of A and B is:

M = x1 + x2
2
,
y1 + y2
2 ### Example: Midpoint and Distance on Cartesian Plane

Question: Calculate the distance and midpoint between points T (2, 3) and R (8, 10) to the nearest tenth of a decimal place

So, our equation for distance between two points on two dimensional Cartesian plane is,

dist(A, B) = (Δ x)2 + (Δ y)2

So for,

dist(T, R) = (x2 - x1)2 + (y2 - y1)2
dist(T, R) = (8 - 2)2 + (10 - 3)2
dist(T, R) = 62 + 72
dist(T, R) = 36 + 49
dist(T, R) = 85
= 9.2

The midpoint is,

M = x1 + x2
2
,
y1 + y2
2 M = 2 + 8
2
,
3 + 10
2 M = 10
2
,
13
2 (5, 6.5)

## Example Distance between point on Cartesian Plane

Question: Find an equation for the line with all the points of P = (x, y) that are an equal distance from S = (1, 2) and T = (4, -2).

For this question, we are looking for all the points that are a equal distance from the points S and T, these points will all be on a straight line, Note, that for every point on the line with all the equal distant points, each point on that line is the same distance from S as it is from T (d1, d2, d3 etc…).

Any point that is not on that line will be closer to either the point T or S.

Now, lets do the math,

We know that the general formula for distance between two points A(x1, y1) and B(x2, y2) is,

dist(A, B) = (x2 - x1)2 + (y2 - y1)2

And we know that all the points P(x, y) are the same distance from S as they are from T,

The distance from P to T is equal to the distance from P to S, so,

dist(P, T) = dist(P, S)

Now, we sub in the values of P(x, y) - which will give us a general equation for the straight line between the two points T and S. We also sub in our T(4, -2) and S(1, 2) into,

dist(P, T) = dist(P, S)

dist(P, T) = (x - 4)2 + (y - (-2)2
dist(P, S) = (x - 1)2 + (y - 2)2

Now equating those two equations, (x - 4)2 + (y - (-2)2
= (x - 1)2 + (y - 2)2

Now, squaring both sides of the equation we get,

(x - 4)2 + (y + 2)2 = (x - 1)2 + (y - 2)2

x2 -8x + 16 + y2 + 4y + 4 = x2 - 2x + 1 + y2 - 4y + 4

Subtract x2 and y2 from both sides of the equation,

-8x + 16 + 4y + 4 = - 2x + 1 - 4y + 4

-8x + 20 + 4y = -2x + 5 - 4y

-8x + 20 + 8y = -2x + 5