What This Calculator Does
This tool computes two fundamental quantities for any two points in three-dimensional space: the straight-line (Euclidean) distance between them, and the midpoint that lies exactly halfway between them. Simply enter the coordinates of point 1 as (x₁, y₁, z₁) and point 2 as (x₂, y₂, z₂), and the calculator returns the distance and the (x, y, z) coordinates of the midpoint.
How to Use It
Type the three coordinates for each point. Coordinates can be positive, negative, or decimal values. The distance is always non-negative, and the midpoint will fall between the two points regardless of their order — swapping the points does not change either result.
The Formula Explained
The distance formula is a direct extension of the Pythagorean theorem into three dimensions. You take the difference along each axis (\(\Delta x = x_2 - x_1\), \(\Delta y = y_2 - y_1\), \(\Delta z = z_2 - z_1\)), square each difference, add them, and take the square root: $$d = \sqrt{\Delta x^2 + \Delta y^2 + \Delta z^2}$$ The midpoint is just the average of the corresponding coordinates: $$M = \left( \dfrac{x_1 + x_2}{2},\; \dfrac{y_1 + y_2}{2},\; \dfrac{z_1 + z_2}{2} \right)$$
Worked Example
Take point 1 = (1, 2, 3) and point 2 = (4, 6, 3). The differences are \(\Delta x = 3\), \(\Delta y = 4\), \(\Delta z = 0\). Squaring and summing gives \(9 + 16 + 0 = 25\), so \(d = \sqrt{25} = 5\). The midpoint is $$\left( \dfrac{1+4}{2},\; \dfrac{2+6}{2},\; \dfrac{3+3}{2} \right) = (2.5,\; 4,\; 3)$$
More Worked Examples with Negative and Decimal Coordinates
The distance formula is \(d = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2 + (z_2-z_1)^2}\) and the midpoint is \(M = \left(\tfrac{x_1+x_2}{2}, \tfrac{y_1+y_2}{2}, \tfrac{z_1+z_2}{2}\right)\). These examples show how the formulas work when coordinates are negative or decimal.
Example 1: Negative coordinates, whole-number distance
Let P1 = (-2, 3, -5) and P2 = (4, -1, 7).
- Differences: \(\Delta x = 4-(-2) = 6\), \(\Delta y = -1-3 = -4\), \(\Delta z = 7-(-5) = 12\).
- Square each difference: \(6^2 = 36\), \((-4)^2 = 16\), \(12^2 = 144\). The square of a negative number is positive, so the sign of each difference does not matter.
- Sum of squares: \(36 + 16 + 144 = 196\).
- Distance: \(d = \sqrt{196} = \) 14.
- Midpoint: \(\left(\tfrac{-2+4}{2}, \tfrac{3+(-1)}{2}, \tfrac{-5+7}{2}\right) = \left(\tfrac{2}{2}, \tfrac{2}{2}, \tfrac{2}{2}\right) = (1, 1, 1)\).
Example 2: Decimal coordinates, irrational distance
Let P1 = (0.5, 1.5, -2) and P2 = (3.5, 5.5, 2).
- Differences: \(\Delta x = 3.5-0.5 = 3\), \(\Delta y = 5.5-1.5 = 4\), \(\Delta z = 2-(-2) = 4\).
- Squares: \(3^2 = 9\), \(4^2 = 16\), \(4^2 = 16\).
- Sum of squares: \(9 + 16 + 16 = 41\).
- Distance: \(d = \sqrt{41} \approx 6.403\).
- Midpoint: \(\left(\tfrac{0.5+3.5}{2}, \tfrac{1.5+5.5}{2}, \tfrac{-2+2}{2}\right) = \left(\tfrac{4}{2}, \tfrac{7}{2}, \tfrac{0}{2}\right) = (2, 3.5, 0)\).
Radical form or decimal?
Since 196 is a perfect square, Example 1 gives the exact answer 14. In Example 2, 41 is not a perfect square, so \(\sqrt{41}\) is irrational and its decimal expansion never ends. Leave the answer as \(\sqrt{41}\) when an exact value is needed, such as in a proof or a symbolic derivation. Use a rounded decimal like 6.403 when you need a measurement, such as a length in a model or drawing. Round only at the end, not after squaring or summing, to avoid accumulating rounding error.
FAQ
Does the order of the points matter? No. Distance uses squared differences, so sign does not matter, and the midpoint uses an average, which is symmetric.
What units are the results in? The same units as your inputs — if coordinates are in meters, the distance is in meters.
Can I use this for 2D problems? Yes — just set \(z_1 = z_2 = 0\) and the formula reduces to the standard 2D distance and midpoint.