Find the distance between two points in 2D or 3D space using the distance formula. Shows step-by-step calculation, midpoint, direction vector, and slope.
The distance between two points is one of the most fundamental calculations in all of mathematics. In two dimensions, the distance formula d = √((x₂−x₁)² + (y₂−y₁)²) is a direct application of the Pythagorean theorem—the horizontal and vertical differences form the legs of a right triangle whose hypotenuse is the desired distance. In three dimensions, the formula extends naturally: d = √((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²).
Beyond the raw distance, this calculator computes several related quantities: the midpoint (the exact center of the segment), the direction vector (which describes the segment's orientation), and in 2D, the slope and angle. These values are essential in analytic geometry, physics (displacement vectors), computer graphics (pixel distances), navigation (GPS coordinates), and engineering.
This tool provides a complete step-by-step breakdown of the calculation, showing each squared difference, the sum, and the final square root. Presets for classic Pythagorean triples and common geometric configurations let you explore instantly. Whether you are working through a geometry assignment, computing distances in a coordinate system, or just need a quick answer, this calculator covers both 2D and 3D with full transparency.
While the distance formula is simple in principle, manual calculation — especially in 3D — involves squaring, adding, and taking square roots of potentially messy numbers. This tool does the arithmetic instantly, shows every intermediate step, and also computes the midpoint, direction vector, and slope so you don't have to run multiple formulas.
It is especially useful for students learning analytic geometry, programmers needing to verify coordinate calculations, and anyone who needs a quick, accurate distance measurement between two points.
2D: d = √((x₂ − x₁)² + (y₂ − y₁)²). 3D: d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²). Midpoint = ((x₁+x₂)/2, (y₁+y₂)/2). Slope m = (y₂ − y₁)/(x₂ − x₁). Direction vector = ⟨x₂−x₁, y₂−y₁⟩.
Result: Distance = 5, Midpoint = (1.5, 2), Slope = 1.333
Δx = 3, Δy = 4. d = √(9 + 16) = √25 = 5. This is the classic 3-4-5 Pythagorean triple. Midpoint = (1.5, 2). Slope = 4/3 ≈ 1.333.
The distance formula is fundamentally the Pythagorean theorem applied to coordinate geometry. Given two points, the horizontal difference Δx and vertical difference Δy form the legs of a right triangle. The hypotenuse of that triangle is the distance we seek. This geometric insight extends to 3D (and higher), where each new dimension simply adds another squared term under the radical.
Distance calculations appear everywhere: GPS navigation computes distances between latitude/longitude coordinates (using a spherical variant), computer games compute distances between objects for collision detection, robotics uses 3D distance for path planning, and data science uses generalized distance metrics (Euclidean, Manhattan, etc.) for clustering and classification algorithms.
While this calculator computes Euclidean (straight-line) distance, other distance metrics exist: Manhattan distance |Δx| + |Δy| (used in grid-based movement), Chebyshev distance max(|Δx|, |Δy|) (used in chess for king moves), and geodesic distance (shortest path on a curved surface). Each metric defines a different "shape" of equidistant regions around a point.
The distance formula d = √((x₂−x₁)² + (y₂−y₁)²) calculates the straight-line distance between two points in a 2D coordinate plane. It is derived from the Pythagorean theorem.
Add the z-component: d = √((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²). The formula generalizes naturally to any number of dimensions.
The midpoint is the point exactly halfway between two endpoints: M = ((x₁+x₂)/2, (y₁+y₂)/2). It divides the segment into two equal halves.
The direction vector ⟨x₂−x₁, y₂−y₁⟩ describes the orientation and displacement of the segment. Dividing it by the distance gives the unit direction vector.
No. Distance is always non-negative. The square root of a sum of squares is always ≥ 0. A distance of 0 means the two points are the same.
A Pythagorean triple is a set of three positive integers (a, b, c) where a² + b² = c². Common examples: (3,4,5), (5,12,13), (8,15,17). They produce integer distances.