How do I use the distance calculator?
Enter the coordinates of two points — x1, y1 and x2, y2 — and the distance, midpoint and slope appear instantly. The defaults (1, 2) and (4, 6) give a distance of 5, a midpoint of (2.5, 4) and a slope of 1.333333. Press Sample for (-2, 3) to (4, -5): distance 10, midpoint (1, -1), slope -1.333333. The details show dx, dy and every step of the working.
What is the distance formula?
The distance between two points comes from Pythagoras' theorem. The horizontal gap dx=x2 - x1 and the vertical gap dy=y2 - y1 form the two shorter sides of a right triangle, and the distance is the hypotenuse: sqrt(dx^2 + dy^2). For (1, 2) to (4, 6): dx=3, dy=4, so the distance is sqrt(9 + 16)=sqrt(25)=5 — the classic 3-4-5 triangle.
How do you find the midpoint?
The midpoint is the point exactly halfway between the two points. Average the x-coordinates and average the y-coordinates: ((x1 + x2)/2, (y1 + y2)/2). For (1, 2) and (4, 6) that is ((1 + 4)/2, (2 + 6)/2)=(2.5, 4). The midpoint is the same distance from both endpoints, which makes it useful for finding the centre of a segment, a circle's diameter endpoints, or a meeting point.
What is the slope between two points?
The slope measures how steep the line through the points is: slope=dy/dx=(y2 - y1)/(x2 - x1) — rise over run. A positive slope climbs to the right, a negative slope falls, and zero is flat. If dx=0 the line is vertical and the slope is undefined, which the tool reports honestly instead of dividing by zero. Slope is the “m” in the line equation y=mx + c.
What is the distance formula used for?
Geometry and coordinate problems, map and GPS distances on flat grids, physics (displacement between two positions), computer graphics and game development (how far apart two objects are), robotics, and anywhere positions are given as coordinates. The midpoint and slope complete the picture: together they describe where the segment is, where its centre is, and which way it points.
Is it free and private?
Yes. The distance calculator is completely free, needs no sign-up, and runs entirely in your browser. Your numbers are never uploaded to a server. It works on phones, tablets and desktop computers.