What This Calculator Does
This tool analyzes the relationship between two points on a 2D coordinate plane. Enter the coordinates of Point 1 (x₁, y₁) and Point 2 (x₂, y₂) and it instantly returns the distance between them, the midpoint of the segment joining them, and the slope of the line passing through them. These three quantities are the foundation of coordinate (analytic) geometry and appear throughout algebra, geometry, trigonometry, and physics.
How to Use It
Type the four coordinate values into the boxes. Values can be positive, negative, or decimal. Press calculate and read off the distance in the hero box and the midpoint and slope in the table below. If the two points share the same x-value, the line is vertical and the slope is reported as undefined.
The Formulas Explained
The distance comes from the Pythagorean theorem applied to the horizontal change \(\Delta x = \text{x}_2 - \text{x}_1\) and vertical change \(\Delta y = \text{y}_2 - \text{y}_1\):
$$d = \sqrt{\Delta x^2 + \Delta y^2}$$The midpoint is simply the average of the two x-coordinates and the two y-coordinates:
$$M = \left( \frac{\text{x}_1 + \text{x}_2}{2},\ \frac{\text{y}_1 + \text{y}_2}{2} \right)$$The slope is rise over run:
$$m = \frac{\text{y}_2 - \text{y}_1}{\text{x}_2 - \text{x}_1}$$which is undefined when \(\text{x}_2 = \text{x}_1\).
Worked Example
For Point 1 (1, 2) and Point 2 (4, 6): \(\Delta x = 3\), \(\Delta y = 4\), so
$$d = \sqrt{9 + 16} = \sqrt{25} = 5$$$$M = \left( \frac{1+4}{2},\ \frac{2+6}{2} \right) = (2.5,\ 4)$$$$m = \frac{6 - 2}{4 - 1} = \frac{4}{3} \approx 1.3333$$
FAQ
Why is my slope "undefined"? A vertical line has no run (\(\text{x}_2 = \text{x}_1\)), so division by zero makes the slope undefined.
Does point order matter? No. Distance and midpoint are identical either way, and slope is the same because both the numerator and denominator flip sign together.
Can I use negative coordinates? Yes — the formulas work for any real numbers, including negatives and decimals.