Coordinate geometry

Distance and Midpoint Formula Sheet

Decide whether you are finding a length, a point halfway along a segment, or a point that divides it in a given ratio.

On this page

Find a formula

Open a formula for its definition and a worked example.

Distance in one, two or three dimensions

  • Use the coordinate differences1D |Δx|, 2D √(Δx² + Δy²), 3D √(Δx² + Δy² + Δz²)Each Δ is the coordinate of the endpoint minus that of the starting point.

    What it does

    Euclidean distance is the length of the coordinate difference vector. One dimension uses an absolute value and higher dimensions combine squared perpendicular changes.

    Worked example

    Use A = (−1, 2, 1) and B = (2, 6, 13). Find the distance in space and after projecting onto the xy-plane and x-axis.

    1. The coordinate differences are 3, 4 and 12.
    2. In space the distance is √(9 + 16 + 144) = 13, in the plane it is √(9 + 16) = 5, and along x it is 3.
    Link to this example
  • Measure from the origin2D √(x² + y²), 3D √(x² + y² + z²)

    What it does

    From the origin, coordinate differences equal the coordinates of the destination itself. Square, add and take a square root.

    Worked example

    Find distances from the origin to (6, 8) and (6, 8, 24).

    1. In the plane compute √(36 + 64) = 10.
    2. In space add 24² to 100 and take √676 = 26.
    Link to this example

Find the point halfway

  • Average matching coordinatesM = (A + B)/2On a line, average the two numbers. In the plane or in space, average the two x-coordinates, the two y-coordinates, and the two z-coordinates when present.

    What it does

    The midpoint divides a segment into two equal lengths. Its coordinates are the averages of the corresponding endpoint coordinates.

    Worked example

    Find the midpoint of A = (−2, 5, 6) and B = (4, −1, 2), including its xy and x projections.

    1. Average the pairs to get x = 1, y = 2 and z = 4.
    2. The midpoint is (1, 2, 4). Its xy projection is (1, 2) and its x coordinate is 1.
    Link to this example

Divide a segment by a ratio

  • Weight the endpoint coordinatesInside P = (nA + mB)/(m + n), outside P = (mB − nA)/(m − n)Compute each coordinate using AP:PB = m:n and m, n > 0. The external point requires m ≠ n.

    What it does

    A partition point weights the endpoints to achieve AP:PB = m:n. The internal point uses positive weights, while an external point extrapolates and requires m ≠ n.

    Worked example

    Let A = (0, 0) and B = (6, 3). Divide the line internally and externally in the ratio AP:PB = 2:1.

    1. Internal division gives (A + 2B)/3 = (4, 2).
    2. External division gives (2B − A)/(2 − 1) = (12, 6), so AP is twice PB there as well.
    Link to this example
  • Find the triangle’s centroidG = (A + B + C)/3Average the three coordinates along each axis.

    What it does

    The centroid is the intersection of a triangle’s medians. Each coordinate equals the mean of the three vertex coordinates.

    Worked example

    Find the centroid of (0, 0), (9, 0) and (0, 6).

    1. Average the x-coordinates to get (0 + 9 + 0)/3 = 3.
    2. Average the y-coordinates to get (0 + 0 + 6)/3 = 2. The centroid is (3, 2).
    Link to this example

Find a perpendicular distance

  • Measure from a point to a lined = |Ax₀ + By₀ + C|/√(A² + B²)For y = mx + b this becomes |mx₀ − y₀ + b|/√(m² + 1). A and B cannot both vanish.

    What it does

    Point-to-line distance is the perpendicular separation. Divide the absolute value of the line equation at the point by the length of the line’s normal vector.

    Worked example

    Find the distance from (2, 1) to 3x − 4y + 8 = 0.

    1. The numerator is |6 − 4 + 8| = 10.
    2. The normal length is √(9 + 16) = 5, giving distance 2.
    Link to this example
  • Measure between parallel linesd = |C₁ − C₂|/√(A² + B²)First write both lines as Ax + By + C_i = 0 using the same A and B.

    What it does

    Parallel lines can share the same normal coefficients A and B. Their distance is the absolute difference of the constants divided by the normal length.

    Worked example

    Find the distance between 3x + 4y − 10 = 0 and 6x + 8y + 10 = 0.

    1. Divide the second equation by 2 so both normal vectors are (3, 4). The constants are −10 and 5.
    2. Divide |−10 − 5| by √(9 + 16) to get 3.
    Link to this example

Connect distance to vectors and triangles

  • Apply the right-triangle relationshipa² + b² = c², ‖v‖ = √(vx² + vy²) in 2D or √(vx² + vy² + vz²) in 3DIn 3D, first find the length of the projection into a coordinate plane, then add the third component by Pythagoras.

    What it does

    Pythagoras combines perpendicular component lengths into a hypotenuse. In three dimensions apply it again with the third component.

    Worked example

    Find the magnitudes of vectors ⟨8, 15⟩ and ⟨8, 15, 0⟩, then of ⟨8, 15, 12⟩.

    1. The first two have the same magnitude √(8² + 15²) = 17.
    2. Adding the third component 12 gives √(17² + 12²) = √433.
    Link to this example
  • Find a triangle’s circumradiusR = abc/(4K)The triangle must be nondegenerate, with side lengths a, b, c and area K > 0.

    What it does

    The circumradius is the distance from a triangle’s circumcenter to any vertex. Given a positive area, divide the product of its sides by four times that area.

    Worked example

    Find the circumradius of a right triangle with sides 6, 8 and 10.

    1. Its area is 6·8/2 = 24.
    2. Substitute R = 6·8·10/(4·24) = 5, half the hypotenuse.
    Link to this example
See Geometry formula sheet

Use coordinates to solve a geometry problem

  • Choose which point pairs to measureDiameter d = distance between opposite circle points. Square side s = distance between adjacent vertices. Triangle perimeter = AB + BC + CA.Two arbitrary points on a circle define a chord. Check that the chord crosses the center before calling it a diameter.

    What it does

    Use a distance formula on the appropriate segment. Opposite circle points form a diameter, adjacent square vertices form a side, and a triangle’s three side lengths sum to its perimeter.

    Worked example

    Use A = (0, 0), B = (3, 0) and C = (0, 4). Find the triangle perimeter, the length of AB as a square side, and BC as the diameter of the circle centered at its midpoint.

    1. The lengths are AB = 3, AC = 4 and BC = √(9 + 16) = 5.
    2. The perimeter is 12, the square side is 3 and the circle diameter is 5.
    Link to this example
  • Find a circle center from three pointsCenter = intersection of two chord perpendicular bisectorsChoose three noncollinear points and use two chords with different directions.

    What it does

    The center of a circle is equidistant from each chord’s endpoints, so it lies on the chord’s perpendicular bisector. Two nonparallel chords determine the center.

    Worked example

    Find the circle center through (0, 0), (6, 0) and (0, 4).

    1. The horizontal chord gives perpendicular bisector x = 3 and the vertical chord gives y = 2.
    2. Their intersection (3, 2) is the center.
    Link to this example

Preview the printable

Download the compact sheet for a quick review, or print the complete formula list from this page.

Practice these skills

Related references

Sources and review

Math Sheet prepares original print materials. See how we check formulas and printouts.

Browse all formula sheets →