# Length of a line segment

Let and be the coordinates of a line segment . We have:

As in the case of the midpoint of a line segment, the above distance/length formula is very easy to use.

#### Example 1

Find the length of the line segment joining the points and .

Let the length be . We have, by the distance formula, that

Therefore, the line segment is units long.

#### Example 2

Find the distance from the origin to the point .

Let the distance be . Since the origin is the point , we have, by the distance formula, that

The required distance is units.

#### Example 3

Find the distance between and .

By the distance formula, we have:

Using a calculator, we obtain that .

#### Example 4

Determine the possible value(s) of for which the distance between and is units.

We have, by the distance formula, that

We now simplify and solve:

Therefore, there are two possible values of : or .

#### Example 5

For any number , prove that the distance between the points and is units.

Let the distance be . We have, by the distance formula, that:

as required. This seems to suggest, as we would expect, that the length of a line segment is invariant under a translation.

#### Example 6

Let be a given point. Find the coordinates of a point that has a distance of units from . How many possibilities are there?

Let the coordinates of point be . Since the distance between and is units, we have, by the distance formula, that:

Squaring both sides gives , or . We now use trial-and-error (or, guess-and-check) to find a possible solution. Let’s try and :

Oops doesn’t work. Let’s try and :

Works! So, a possible choice of coordinates for is . Let’s see if we can find another set of coordinates. Put and :

Works again!! Let’s try and :

Works again!!! In general, there’s an infinite number of solutions to this problem. Later on we’ll recognize the equation as that of a circle, and any point on (the circumference of) the circle is a solution.

## Classifying triangles using the length formula

As you’ll recall, a triangle can be SCALENE (all three sides are of different lengths), ISOSCELES (two sides have the same length), or EQUILATERAL (all three sides have the same length). If we know the coordinates of the vertices of the triangle, we can use the distance formula to determine what type of triangle it is.

#### Example 7

What type of triangle is formed by the points ?

We’ll need to compare the lengths of the sides of the triangle. Let’s calculate the lengths of , and using the distance formula:

Since , the given triangle is ISOSCELES. Additionally, this triangle contains , due to the fact that (alternatively, this can also be seen by calculating the slopes of and , which are and , respectively).

#### Example 8

Determine an appropriate choice of coordinates for points such that the resulting triangle will be equilateral.

In the exercises below, we give a general strategy for constructing an equilateral triangle using coordinates. For now, we use that knowledge to solve this challenge. Let’s choose and use the distance formula to find the lengths of :

It works! We conclude that the triangle with coordinates at is equilateral.

## How slope affects the length of a line segment

The slope formula and the distance formula are quite “similar” — in the sense that they both use the “same numbers” but with different operations on them:

Because of this, we can expect some relationship between the two.

#### Example 9

Prove that if a line segment with integer coordinates has a slope of , then ITS LENGTH CAN NEVER BE AN INTEGER.

Let be the length of a line segment that satisfies the specified condition. Suppose that is the point and is the point . Since the slope of is , we have, by the slope formula, that

We now have, by the distance formula, that

The resulting length is a positive integer multiple of . Since is not an integer, is not.

In the next example, we prove that the same thing happens whenever the slope of the line segment is an integer other than (excepting zero).

#### Example 10

Prove that if a line segment with integer coordinates has a slope that is an integer, then ITS LENGTH CAN NEVER BE AN INTEGER.

As before, let be the length of a line segment that satisfies the given condition. Suppose that is the point and is the point . Since the slope of is , we have, by the slope formula, that

We now have, by the distance formula, that

The resulting length is a positive integer multiple of . Since is not an integer (except when ), is not.