Distance Formula
3D: d = √((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²)
Midpoint: M = ((x₁+x₂)/2, (y₁+y₂)/2)
Example
Points A(3, 4) and B(7, 1)
d = √((7−3)² + (1−4)²) = √(16 + 9) = √25 = 5
Midpoint = ((3+7)/2, (4+1)/2) = (5, 2.5)
Slope = (1−4)/(7−3) = −3/4 = −0.75
Distance Formula Applications
| Application | What it finds |
|---|---|
| GPS / navigation | Straight-line distance between coordinates |
| Computer graphics | Pixel distance, collision detection |
| Physics | Displacement between two positions |
| Data science | Euclidean distance in feature space (kNN) |
| Engineering | Length of structural members from endpoints |
Frequently Asked Questions
What is the difference between distance and displacement?
Distance is the total path length traveled (scalar, always positive). Displacement is the straight-line distance from start to end with direction (vector). This calculator computes straight-line Euclidean distance — equivalent to displacement magnitude.
What is Manhattan distance?
Manhattan (or taxicab) distance = |x₂−x₁| + |y₂−y₁|. It measures distance along grid lines (like city blocks) rather than straight lines. It is used in machine learning and grid-based pathfinding algorithms. This calculator computes Euclidean (straight-line) distance.
How do I find the distance between GPS coordinates?
For GPS coordinates (latitude/longitude), use the Haversine formula, which accounts for Earth's curvature. The flat-plane distance formula only works for small local distances where curvature is negligible. For large distances between cities, the Haversine result differs significantly from flat-plane Euclidean distance.