How to Use the Two-Point Distance Calculator
Enter the x and y coordinates of two points to instantly calculate the straight-line distance between them, the coordinates of the midpoint, and the slope of the line connecting them.
Formulas Used
Distance: d = โ((xโโxโ)ยฒ + (yโโyโ)ยฒ) โ derived from the Pythagorean theorem. Midpoint: M = ((xโ+xโ)/2, (yโ+yโ)/2). Slope: m = (yโโyโ)/(xโโxโ).
Vertical Lines and Undefined Slope
When both points share the same x-coordinate, the connecting line is vertical. Slope requires dividing by ฮx = 0, which is undefined. The calculator displays "Undefined (vertical line)" clearly rather than showing an error or wrong value.
Practical Applications
Finding the radius of a circle (distance from center to a point on the circle), locating the midpoint of a line segment, writing the equation of a line using point-slope form, and verifying geometric properties in coordinate proofs.
Frequently Asked Questions
Yes. Negative coordinates work exactly the same. For example, P1(โ3, 2) and P2(1, โ4) gives d = โ(16+36) = โ52 โ 7.2111.
The distance is 0, the midpoint equals the point itself, and the slope is 0 รท 0 โ undefined. All results are still shown, with slope displayed as "Undefined."
The output units match your input units. Enter coordinates in meters and the distance is in meters; enter in feet, and distance is in feet.