What the distance formula is and when to use it
The distance formula finds the straight-line ("Euclidean") distance between two points in a coordinate plane or in 3D space. It is a direct application of the Pythagorean theorem: the difference in each coordinate axis forms a leg of a right triangle (or, in 3D, an extra dimension of separation), and the straight-line distance is the hypotenuse. This calculator automatically switches between the 2D and 3D versions of the formula — leave both Z fields blank for a flat, two-coordinate distance, or fill in Z1 and Z2 for a three-dimensional calculation.
Use it in geometry and algebra coursework to find the distance between two points on a graph, in physics or engineering to find the straight-line separation between two positions in space, or in any practical mapping context where you have two (x, y) or (x, y, z) coordinates and need the direct distance between them (not a path distance along roads or a grid).
The formula
2D: d = √[(x2 − x1)² + (y2 − y1)²]
3D: d = √[(x2 − x1)² + (y2 − y1)² + (z2 − z1)²]
- (x1, y1[, z1]) — the coordinates of the first point.
- (x2, y2[, z2]) — the coordinates of the second point.
- d — the straight-line distance between the two points, in whatever units the coordinates are measured in.
Worked example
For the 2D case, take Point 1 = (1, 2) and Point 2 = (4, 6). Δx = 4 − 1 = 3, Δy = 6 − 2 = 4. d = √(3² + 4²) = √(9 + 16) = √25 = 5 — a classic 3-4-5 right triangle, matching what the calculator returns for these inputs.
For the 3D case, take Point 1 = (0, 0, 0) and Point 2 = (2, 3, 6). Δx = 2, Δy = 3, Δz = 6. d = √(2² + 3² + 6²) = √(4 + 9 + 36) = √49 = 7, which the calculator returns when you fill in all three coordinates for both points.
Common mistakes and how to interpret the result
- Forgetting to leave Z blank for a 2D problem. If you only need the 2D distance, leave both Z1 and Z2 empty — entering a 0 in only one of them still triggers the 3D formula and can silently change your answer.
- Subtracting coordinates in the wrong order inconsistently. It doesn't matter whether you compute (x2 − x1) or (x1 − x2) since the difference is squared, but be consistent about which point is "1" and which is "2" when interpreting direction, not just distance.
- Confusing straight-line distance with path distance. This formula gives the direct ("as the crow flies") distance — it does not account for obstacles, roads, or grid-based movement (like city blocks), which require different distance metrics.
- Mixing units between coordinates. All coordinates must be in the same unit (all meters, all feet, etc.) — mixing units invalidates the result.
Frequently Asked Questions
How is the distance formula related to the Pythagorean theorem?
Can the distance ever be negative?
Does the order of the two points matter?
How do I extend this to more than three dimensions?
Common Tip Percentages
| Service | Typical Tip Range | Notes |
|---|---|---|
| Restaurant (sit-down) | 15–20% | 20%+ for exceptional service |
| Food delivery | 10–20% | Consider extra for long distances |
| Taxi / rideshare | 10–20% | More for assistance with luggage |
| Hotel housekeeping | $2–5/night | Leave daily, not just at checkout |
| Barber / hair salon | 15–20% | On pre-discount total |
| Pizza delivery | 10–15% or $3–5 minimum | Higher in bad weather |
General Household Budget Ratios (50/30/20 Rule)
| Category | % of Net Income | Examples |
|---|---|---|
| Needs | 50% | Rent, groceries, utilities, insurance |
| Wants | 30% | Dining out, entertainment, hobbies |
| Savings / Debt | 20% | Emergency fund, retirement, extra payments |
Common Measurement Conversions for Everyday Use
| Quantity | US / Imperial | Metric Equivalent |
|---|---|---|
| 1 cup | 8 fl oz | 237 mL |
| 1 pint | 16 fl oz | 473 mL |
| 1 quart | 32 fl oz | 946 mL |
| 1 gallon | 128 fl oz | 3.785 L |
| 1 lb | 16 oz | 453.6 g |
| 1 ft | 12 in | 30.48 cm |