We have learned about the distance formula and we also have discussed how to get the distance between two points given their coordinates. In this post, we are going to explore a simpler concept: getting the distance between two points on the number line.

Suppose we want to get the distance between two p0ints on the number line whose coordinates are integers, we can just do it by counting. In the figure below, the distance from to is , and the distance from to is .

It is also obvious that we can get the distance by subtraction: and . It is clear that if we let be the larger integer, and be the smaller, then the distance can between the two integers is . It is also clear that this formula applies to non-integral coordinates.

The distance between and , however, is just the same as the distance between and , so the values of and should be interchangeable. However, if we do, if and , then . But distance is not supposed to be negative, so we get the negative of which is . It follows from above that if , the distance between and is . Of course, if , then .

If we denote the distance between and as , then, the distance equals

- if
- if
- if .

*absolute value*. The notation $latex is read as the absolute value of .

Geometrically, if is any real number, then means units from 0; that is, the distance of from .

**Some Examples**

Example 1: We can easily see that |5| = 5 and that |-5| = 5. Hence, the |-5| is the distance from 0 to -5 which equals 5 units.

**A more compact notation**

Notice that the notation above can be simplified to