Distance Calculator
Distance: 199.830505 km
- Distance
- 199.830505 km
- Distance
- 124.168919 mi
- Midpoint latitude
- 39.42°
- Midpoint longitude
- -76.09°
Coordinate distance (longitude, latitude)
What this calculator does
The Distance Calculator finds the straight-line distance between two points and the midpoint of the segment that joins them. It supports both two-dimensional coordinates (x, y) and three-dimensional coordinates (x, y, z).
Straight-line distance is a core measurement in geometry, mapping, engineering, physics, and computer graphics. It answers how far apart two locations are when travel is not constrained by roads or obstacles. The midpoint is equally useful: it identifies the exact center of a segment, which matters in design, surveying, and computer-aided drafting.
How to use this calculator
- Choose 2D or 3D coordinates.
- Enter the coordinates of point 1.
- Enter the coordinates of point 2.
- Click Calculate and review the distance, coordinate changes, and midpoint.
The default 2D example uses point 1 at (1, 1) and point 2 at (4, 5). The distance is 5 units, the horizontal change is 3, the vertical change is 4, and the midpoint is (2.5, 3). In 3D mode, the example points (1, 1, 1) and (2, 2, 2) are about 1.7321 units apart, with midpoint (1.5, 1.5, 1.5).
Distance formulas
2D distance: d = √((x₂ − x₁)² + (y₂ − y₁)²)
3D distance: d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²)
Midpoint: ((x₁ + x₂) / 2, (y₁ + y₂) / 2)
3D midpoint: ((x₁ + x₂) / 2, (y₁ + y₂) / 2, (z₁ + z₂) / 2)
The formulas come from the Pythagorean theorem. In two dimensions, the horizontal and vertical changes form the legs of a right triangle, and the distance is the hypotenuse. In three dimensions, the same idea is applied twice, adding the vertical z change.
What the results mean
The highlighted result is the straight-line distance. The Δx, Δy, and optional Δz rows show the signed coordinate changes from point 1 to point 2. The midpoint rows give the coordinate averages, which locate the point exactly halfway between the two endpoints.
The distance is always zero or positive. It is zero only when the two points are identical. The midpoint can have positive, negative, or zero coordinates depending on the endpoints.
Assumptions and limitations
- The calculator works in ordinary flat Euclidean space. It does not account for Earth's curvature.
- In 3D mode, all three coordinates are required for both points.
- Coordinates may be positive, negative, or zero, but they must be finite numbers.
- All coordinates must use the same unit. The distance is reported in that unit; the midpoint coordinates use it as well.
- The result is a straight-line distance, not a driving distance, walking route, or travel time.
- The calculator does not support polar coordinates, latitude and longitude, or other coordinate systems.
- Results are rounded for display.
Frequently asked questions
Is this the same as driving distance?
No. The calculator returns the straight-line, or as-the-crow-flies, distance between two points. Driving distance follows roads and can be much longer. For route distance, use a mapping service that models the road network.
How is the midpoint calculated?
The midpoint is the average of the two endpoints. Add the two x-coordinates and divide by two, then do the same for y and, in 3D mode, z. The resulting point lies on the straight segment and is the same distance from each endpoint.
Can I use 3D distance for real objects?
Yes, when the coordinates describe positions in a rectangular 3D coordinate system. For example, you can measure the diagonal distance between opposite corners of a room or the separation between two points in a CAD model. Make sure the x, y, and z axes are perpendicular and share the same unit.
Reference table
Coordinate distance formulas
| arctan( | ΔY | ) |
|---|---|---|
| θ | ΔY | ΔX |
| Angle from the positive x-axis | Vertical change (y₂ − y₁) | Horizontal change (x₂ − x₁) |
For two Cartesian points, distance = √(ΔX² + ΔY²). For 3D points, add ΔZ² under the same square root. Latitude/longitude mode uses the haversine formula instead.
Source
Reference: Calculator.net — Distance Calculator.
This page is for general educational and estimation purposes. For navigation or legal boundary work, use a dedicated surveying or geographic information system.
Math Calculators
- Scientific Calculator
- Fraction Calculator
- Percentage Calculator
- Percent Error Calculator
- Random Number Generator
- Exponent Calculator
- Binary Calculator
- Hex Calculator
- Half-Life Calculator
- Quadratic Formula Calculator
- Log Calculator
- Ratio Calculator
- Root Calculator
- Least Common Multiple Calculator
- Greatest Common Factor Calculator
- Factor Calculator
- Rounding Calculator
- Matrix Calculator
- More Math Calculators