# Calculate the length of a line segment

Remember that a line segment is the portion of a straight line that directly connects two given points. Unlike a line, it does not extend off to infinity in both directions. To find the length, we just use the distance formula between the two points provided. For lessons like this, often the easiest way to learn is by working out an example.

### Example:

Find the distance between (-2,8) and (-7,-5). Said another way, find the length of the line segment between points (-2,8) and (-7,-5).

First, find the distance between the x-coordinates. To do this, subtract one number from the other and then take its absolute value.

We have: |-2-(-7)| = |5| = 5.

Then repeat with the y-coordinates.

We have: |8-(-5)| = |13| = 13.

NOTE: It does NOT matter which way you subtract the numbers because the absolute value of the answer would be the same anyway.

Finally, to compete the length (or distance), square BOTH values, add them, and take the square root. Here's the first part:

$$5^2 + 13^2 = 25 + 169 = 194$$

Taking the square root of 194 and rounding to TWO decimal places, we get a distance of 13.93:

$$\sqrt(194)=13.93$$

By the way, what you are actually doing is using the Pythagorean Theorem on an imaginary right triangle with the line joining the two lines being the hypotenuse.

The general formula for distance between two points is the following: $$\sqrt{x^2 + y^2}$$, where x and y are the change in x and y between the two points.

Provided by Mr. Feliz