Skip to content
Study Hall
Lesson 1 of 4Analytic Geometry
Unit 2 · Lesson 1 of 4

Midpoint and Length of a Line Segment

Two formulas that turn coordinates into geometry: the midpoint formula averages the endpoints, and the length formula is the Pythagorean theorem written with coordinates. Learn where each one comes from, use both, and work backwards from a midpoint to a missing endpoint.

7 min read11 practice questionsInteractiveAsk AI about this →

Key things to remember

  1. 1Midpoint of and : , the average of the coordinates.
  2. 2Length of a segment: the Pythagorean theorem with the run and the rise as legs.
  3. 3Horizontal or vertical segment: the length is the difference of the coordinates that change (larger minus smaller).
  4. 4To find a missing endpoint, repeat the move from the known endpoint to the midpoint: .
  5. 5Give exact lengths as simplified radicals, such as , and round only the final decimal.

Amara and Ben live in the same town. On a city map drawn on a grid where each square is km wide, Amara's home is at and Ben's is at . They want to meet at a café exactly halfway between their homes, and they want to know how far apart they live in a straight line ("as the crow flies"). You could measure the map with a ruler, but a ruler gives an estimate that depends on how carefully the map was drawn. Analytic geometry answers both questions exactly, using nothing but the coordinates. By the end of this lesson you will be able to say that the café belongs at and that the homes are exactly km apart, and you will know why.

A line segment is the part of a line between two endpoints. It is named by its endpoints, so the segment from to is written . The midpoint of a segment is the point on the segment that is the same distance from both endpoints; it cuts the segment into two equal halves. The length of a segment is the distance between its endpoints. To write formulas that work for any segment, label the endpoints with subscripts: the first endpoint is and the second is . The small and are labels, not exponents: is read "x one" and just means "the x-coordinate of the first point".

−3−2−1123456−112345678910xyA(−2, 1)B(4, 9)C(4, 1)M(1, 5)run = 6rise = 83410Midpoint: average the coordinatesx: (−2 + 4) ÷ 2 = 1y: (1 + 9) ÷ 2 = 5M = (1, 5)Length: Pythagorean theoremrun = 4 − (−2) = 6rise = 9 − 1 = 8AB² = 6² + 8² = 100AB = √100 = 10Half the run (3) and half the rise (4)from A lands on the midpoint M.
Fig 1The segment from A(−2, 1) to B(4, 9) on a grid. Its midpoint M(1, 5) is halfway across and halfway up. A right triangle with legs 6 and 8 has the segment as its hypotenuse, so the length is 10.
Wide aerial view of downtown Toronto from the CN Tower, with office towers in front and city blocks stretching north to the horizon.
PhotoToronto's streets are laid out in blocks that work like a coordinate grid, so the point halfway between two places, and the straight-line distance between them, can be calculated from coordinates.DXR, CC BY-SA 4.0, via Wikimedia Commons

Developing the midpoint formula

Look only at the x-coordinates first. Going from to , the x-coordinate runs from to . The number halfway between and on a number line is their average (mean): . Now the y-coordinates: halfway between and is . So the midpoint is . Why can the two coordinates be treated separately? From to the segment goes right (the run) and up (the rise). Starting at and going half the run and half the rise ( right and up) lands on the segment, because the slope stays . That point is exactly halfway along. The small triangle from to is a half-size copy of the big triangle from to .

Midpoint formula: average the x-coordinates, then average the y-coordinates.
Quick check for a midpoint
The midpoint's x-coordinate must lie between the two endpoint x-coordinates, and the same for y. For and : is between and , and is between and . If your answer is outside those ranges, you probably subtracted instead of adding.

The formula also runs backwards. Suppose is the midpoint of and you know but not . Getting from to takes right (from to ) and down (from to ). Because is halfway, getting from to takes the same move again: right and down, so . Algebraically, set , so and ; and set , so and . Either way, check by finding the midpoint of and : it is .

VideoThe midpoint formula comes from averaging the x-coordinates and the y-coordinates of the two endpoints.Watch on YouTube

Developing the length formula

Horizontal and vertical segments are easy: subtract. From to is units, and from to is units. A slanted segment needs one more idea. Draw a horizontal line through and a vertical line through . They meet at , the corner of a right triangle whose hypotenuse is . The horizontal leg has length and the vertical leg has length . The Pythagorean theorem (, true for every right triangle) gives , so . Amara and Ben live km apart. Replacing the numbers by the general coordinates gives the length formula (also called the distance formula):

Length of the segment from (x1, y1) to (x2, y2): the Pythagorean theorem with the run and rise as the legs.

Three details make the formula reliable. First, the order of the points does not matter: and , because squaring removes the sign. Second, a difference can be negative, so put it in brackets before squaring: , but a calculator reads as . Third, most lengths are not whole numbers. For and : and , so . Give the exact answer as a radical in simplest form by taking out the largest perfect-square factor, , and give a decimal approximation when one is asked for: .

EndpointsRunRiseSum of squaresExact lengthDecimal
and
and
and
and
Run is x2 minus x1 and rise is y2 minus y1. Decimals are rounded to one place.
Loading interactive…
Drag the endpoints of a segment on the grid and watch its exact midpoint, length and slope update, with the working shown for each.
The root of a sum is not a sum of roots
, but . Add the squares first, then take one square root of the total. Adding the roots measures the walk across and then up, which is longer than the straight path for any slanted segment.

With both formulas you can measure any shape whose corners have coordinates. The perimeter of a triangle is the sum of its three side lengths, each found with the length formula. A side length that is a radical can stay exact until the end: a triangle with sides , and has perimeter . Round only the final answer, not the pieces along the way, so rounding errors do not build up.

VideoThe length of a segment is found by drawing a right triangle under it and using the Pythagorean theorem.Watch on YouTube

Worked examples

Reveal one step at a time and try to beat it to the next line.

Example 1
Find the midpoint of the segment joining and .
Example 2
Find the length of the segment from to . Give the exact answer in simplest radical form and a decimal to one place.
Example 3
is the midpoint of , and is . Find the coordinates of .
Example 4
A hiking loop on a park map (units in kilometres) goes from the trailhead to a lookout , then to a waterfall , then back to . Find the total length of the loop, exactly and to one decimal place.

Where marks get lost

  • Subtracting in the midpoint formula. is half the run (how far to move), not the midpoint's coordinate. For and the midpoint is , not .
  • Squaring a negative without brackets: typing into a calculator gives , but . A sum of squares in the length formula can never be negative.
  • Splitting the square root: . Add the squares first, then take one root: , not .
  • Mixing coordinates, such as averaging with . Average x with x and y with y.
  • Finding a missing endpoint by taking the midpoint of and . That gives a point a quarter of the way along. Double the move instead: from and , is .

Flashcards 8

Midpoint of a segment
Midpoint formula
Length (distance) formula
Where the length formula comes from
+ 4 more

Practice

1
What is the midpoint of the segment joining and ?
2
Find the length of the segment from to .
units
3
Find the length of the segment from to , to one decimal place.
units
4
Find the exact length of the segment from to in simplest radical form. (Type a square root as sqrt, for example 2sqrt7.)
5
is the midpoint of and is . What is the y-coordinate of ?
6
Which segment is the longest?
7
A drone flies in a straight line from to on a map with units in kilometres. How far does it fly?
km
8
Find the perimeter of the triangle with vertices , and .
units
9
Match each segment with its exact length.
  1. A.
  2. B.
  3. C.
  4. D.
to
to
to
to
10
Put the steps for finding the exact length of a segment in order.
  1. 1Simplify the radical by taking out the largest perfect-square factor
  2. 2Take the square root of the sum
  3. 3Square the run and the rise and add the squares
  4. 4Label the endpoints and
  5. 5Find the run and the rise by subtracting the coordinates
11
Someone says the midpoint of and is . What went wrong?

Spot a mistake on this page? Let us know