Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Distance, Midpoint & Section Formula Calculator

Distance, midpoint and section formula in 2D or 3D, with every step and a plot.

Math No upload Works offline Free, no sign-up
Point A
Point B
Midpoint M
Point P

Result

Distance —

Details

Step by step

    Next steps

    About the Distance, Midpoint & Section Formula Calculator

    Type the coordinates of two points to get the straight-line (Euclidean) distance between them, the Manhattan and Chebyshev distances and the midpoint — in 2D or 3D, with the distance formula worked through and the answer kept exact: (−5, 7) to (−1, 3) is 4√2, not just 5.6569.

    The other tabs cover the rest of the chapter: find a missing endpoint from the midpoint; find the point that divides a segment internally or externally in the ratio m : n (the section formula), or the points that cut it into equal parts; find the ratio in which a given point, the x-axis, the y-axis or a line divides a segment; and test whether three or more points lie on one straight line. In 2D every answer is plotted.

    How to use it

    1. Choose a tab, and 2D or 3D.
    2. Type the coordinates. Fractions (3/2), negative numbers and roots (√2) all work.
    3. For the section formula, enter the ratio m : n and choose internal or external division. For collinear points, type one point per line.
    4. Read the result, the steps and the plot, and copy or download the working.

    Examples

    Distance
    Input
    (−5, 7) and (−1, 3)
    Result
    d = 4√2 ≈ 5.6569

    √((−1 + 5)² + (3 − 7)²) = √(16 + 16) = √32.

    3D distance
    Input
    (1, 2, 3) and (4, 6, 15)
    Result
    d = 13

    √(3² + 4² + 12²) = √169. The direction cosines are 3/13, 4/13 and 12/13.

    Section formula
    Input
    A(−1, 7), B(4, −3), ratio 2 : 3
    Result
    P(1, 3)

    x = (2 × 4 + 3 × (−1))/5 = 1 and y = (2 × (−3) + 3 × 7)/5 = 3.

    Points of trisection
    Input
    A(2, −2), B(−7, 4)
    Result
    (−1, 0) and (−4, 2)

    They divide AB in the ratios 1 : 2 and 2 : 1.

    Ratio by a point
    Input
    P(−1, 6) on A(−3, 10)–B(6, −8)
    Result
    2 : 7, internally

    k = (−1 + 3)/(6 + 1) = 2/7 from the x-coordinates; the y-coordinates give the same k.

    Ratio by the x-axis
    Input
    A(1, −5), B(−4, 5)
    Result
    1 : 1 at (−3/2, 0)

    On the x-axis y = 0, so k = −y₁/y₂ = 5/5 = 1.

    Collinear points
    Input
    (1, 5), (2, 3), (−2, 11)
    Result
    collinear, on 2x + y − 7 = 0

    1(3 − 11) + 2(11 − 5) + (−2)(5 − 3) = 0, so the triangle has no area.

    Common uses

    • Coordinate-geometry homework: the distance, midpoint and section formulae, trisection points and collinearity.
    • Finding the exact centre between two locations on a map grid or a drawing.
    • Checking straight-line against grid (Manhattan) distances for routing on a street grid.
    • 3D work: the length and direction cosines of a segment between two points in space.

    The formulas

    The distance and section formulae are the ones taught in NCERT Class 10 Mathematics (Coordinate Geometry); external division and the 3D versions extend them in the same way.

    • Distance: d = √((x₂ − x₁)² + (y₂ − y₁)²), with + (z₂ − z₁)² in 3D. It is Pythagoras’ theorem on the horizontal and vertical legs Δx and Δy, which the plot draws dashed.
    • Midpoint: M = ((x₁ + x₂)/2, (y₁ + y₂)/2), so the other end is B = (2xₘ − x₁, 2yₘ − y₁).
    • Section formula, internal: P = ((mx₂ + nx₁)/(m + n), (my₂ + ny₁)/(m + n)); external: P = ((mx₂ − nx₁)/(m − n), (my₂ − ny₁)/(m − n)), with m ≠ n.
    • Manhattan distance |Δx| + |Δy| (+ |Δz|) is the distance along a street grid; the Chebyshev distance, the largest of |Δx|, |Δy| and |Δz|, is the number of king moves on a chessboard.

    Finding the ratio

    Let P divide AB in the ratio k : 1, so P = ((kx₂ + x₁)/(k + 1), (ky₂ + y₁)/(k + 1)). When P is given, solve for k from one coordinate and check the others: they must give the same k, or P is not on the line AB. On the x-axis y = 0, so k = −y₁/y₂; on the y-axis k = −x₁/x₂; for a line ax + by + c = 0, k = −(ax₁ + by₁ + c)/(ax₂ + by₂ + c). A positive k means P lies between A and B (internal division); a negative k means P lies on the line AB beyond A or B (external division).

    Collinear points

    Three points are collinear when the triangle they form has zero area: ½|x₁(y₂ − y₃) + x₂(y₃ − y₁) + x₃(y₁ − y₂)| = 0. With more points, the tool tests each one against the first two. In 3D it uses the cross product: P₁P₂ × P₁Pᵢ = 0 exactly when Pᵢ is on the line through P₁ and P₂. For collinear points in 2D you also get the equation of their line, and for three points that are not collinear, the area of their triangle.

    Limitations

    • The plot is drawn for 2D results; 3D answers come with all the numbers and steps.
    • Exact fractions and roots are kept while they stay short; otherwise answers are decimals (double precision, about 15 significant digits).
    • Dividing by an axis or a line works in 2D; in 3D, give the dividing point instead.
    • Distances are in the same units as your coordinates.

    Privacy

    Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.

    Frequently asked questions

    How do I find the distance between two points?

    Subtract the coordinates, square the differences, add them and take the square root: d = √((x₂ − x₁)² + (y₂ − y₁)²). From (1, 2) to (4, 6): √(3² + 4²) = √25 = 5. In 3D, add (z₂ − z₁)² under the root.

    How do I find the midpoint of a segment?

    Average the coordinates: M = ((x₁ + x₂)/2, (y₁ + y₂)/2). For (1, 2) and (4, 6), M = (5/2, 4). To find a missing endpoint B from A and the midpoint M, use B = (2xₘ − x₁, 2yₘ − y₁).

    What is the section formula?

    The point P that divides AB internally in the ratio m : n is ((mx₂ + nx₁)/(m + n), (my₂ + ny₁)/(m + n)) — m goes with B and n with A. For external division, where P lies outside AB, the plus signs become minus: ((mx₂ − nx₁)/(m − n), (my₂ − ny₁)/(m − n)). With m = n = 1, the internal formula gives the midpoint.

    How do I find the points of trisection?

    They divide AB in the ratios 1 : 2 and 2 : 1. For A(2, −2) and B(−7, 4): ((1 × (−7) + 2 × 2)/3, (1 × 4 + 2 × (−2))/3) = (−1, 0), and ((2 × (−7) + 1 × 2)/3, (2 × 4 + 1 × (−2))/3) = (−4, 2). In the section tab, set the number of equal parts to 3.

    How do I check whether three points are collinear?

    Work out the area of the triangle they form: if it is 0, they lie on one line. For (1, 5), (2, 3) and (−2, 11): 1(3 − 11) + 2(11 − 5) + (−2)(5 − 3) = −8 + 12 − 4 = 0, so they are collinear. Equal slopes for AB and BC, or two distances adding up to the third, show the same thing.

    What is the Manhattan distance?

    The distance travelled along a grid of streets, moving only parallel to the axes: |x₂ − x₁| + |y₂ − y₁|. From (1, 2) to (4, 6) it is 3 + 4 = 7, while the straight-line distance is 5.

    Quick answers and tool search

    Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.