Distance Calculator
Calculate the distance between two points in a 2D plane, 3D space, or between two locations using latitude and longitude.
2D Distance Calculator
Find the distance between two points on a 2D coordinate plane.
Point 1
Point 2
3D Distance Calculator
Find the distance between two points in 3D coordinate space.
Point 1
Point 2
Distance Between Two Locations
Calculate the shortest distance between two locations using their latitude and longitude.
Location 1
Location 2
What Is a Distance Calculator?
A distance calculator helps you find the straight-line distance between two points. Depending on the type of calculation, you can measure distance on a two-dimensional coordinate plane, in three-dimensional space, or between geographic locations using latitude and longitude.
2D Distance Formula
The 2D distance formula calculates the distance between two points on a flat coordinate plane. Each point has an x-coordinate and a y-coordinate.
Formula:
d = √[(x₂ − x₁)² + (y₂ − y₁)²]
Subtract the corresponding coordinates, square the differences, add them together, and take the square root of the result.
3D Distance Formula
The 3D distance formula measures the straight-line distance between two points in three-dimensional space. Each point has x, y, and z coordinates.
Formula:
d = √[(x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²]
This formula extends the 2D distance formula by including the difference between the two z-coordinates.
Distance Between Geographic Locations
Geographic distance estimates the shortest distance over the Earth's surface between two locations. This calculator uses latitude and longitude coordinates to determine the distance between the locations.
The great-circle distance represents the shortest path along an idealized spherical Earth. Actual driving or walking distances can be longer because roads and routes do not follow a straight line.
How to Use This Distance Calculator
- Choose the calculator that matches your problem: 2D, 3D, or geographic distance.
- Enter the coordinates of the first point.
- Enter the coordinates of the second point.
- Select the corresponding Calculate button to view the result.
- Use the available Clear button to reset the inputs before performing another calculation.
Common Uses of Distance Calculations
- Mathematics: Solving coordinate geometry and distance formula problems.
- Education: Practising 2D and 3D coordinate calculations.
- Computer graphics: Measuring separation between points in a virtual space.
- Geography: Estimating the distance between locations using geographic coordinates.
- Planning: Comparing straight-line distances before considering actual travel routes.
For another coordinate-based mathematics tool, try our Pythagorean Calculator.
Distance Calculation Examples
Example 1: Distance Between Two 2D Points
Find the distance between A(1, 5) and B(3, 2).
d = √[(3 − 1)² + (2 − 5)²]
d = √[2² + (−3)²] = √13 ≈ 3.61 units
The straight-line distance between the points is approximately 3.61 units.
Example 2: Distance Between Two 3D Points
Find the distance between A(1, 3, 7) and B(2, 4, 8).
d = √[(2 − 1)² + (4 − 3)² + (8 − 7)²]
d = √[1² + 1² + 1²] = √3 ≈ 1.73 units
The distance between the points is approximately 1.73 units.
Example 3: Geographic Distance Between Two Coordinates
Suppose you want to calculate the geographic distance between two points:
- Point 1: Latitude 0°, Longitude 0°
- Point 2: Latitude 0°, Longitude 1°
- Earth radius: 6,371 km
Formula: The calculator uses the Haversine formula to determine the shortest distance along the Earth's surface.
Calculation: For these coordinates, the latitude difference is 0° and the longitude difference is 1°.
Result: The geographic distance is approximately 111.19 km.
This example demonstrates how latitude and longitude coordinates are used to estimate the distance between two geographic locations. Actual road or travel distances may be longer.
Understanding Distance Measurement Units
For 2D and 3D distance calculations, enter all coordinates using consistent units. The calculated distance will use the same unit as the coordinates entered. For example, if you enter coordinates in metres, the result will be in metres.
For geographic distance calculations, enter latitude and longitude in degrees. The calculator displays the result in kilometres (km). Geographic distance represents the shortest distance along the Earth's surface, not the actual road distance.
Frequently Asked Questions
1. How do I calculate the distance between two points?
Enter the coordinates of both points into the appropriate calculator. The 2D and 3D calculators use the distance formula to find the straight-line distance between the points.
2. What is the 2D distance formula?
The 2D distance formula is d = √[(x₂ − x₁)² + (y₂ − y₁)²]. It calculates the straight-line distance between two points on a coordinate plane.
3. How is 3D distance different from 2D distance?
The 2D formula uses x and y coordinates, while the 3D formula also includes the z-coordinate. This allows you to measure distance between points in three-dimensional space.
4. Does the order of the two points affect the distance?
No. Reversing the two points does not change the distance because the formula squares the differences between their corresponding coordinates.
5. Can the distance between two different points be zero?
No. The distance is zero only when both points have identical coordinates. If at least one corresponding coordinate differs, the distance is greater than zero.
6. What units does the Distance Calculator use?
For 2D and 3D calculations, the result is expressed in the same units as the coordinates you enter. For example, if you enter coordinates in metres, the distance will be in metres. For geographic distance calculations, enter latitude and longitude in degrees. The result is displayed in kilometres (km).
7. Is straight-line distance the same as road distance?
No. Straight-line distance measures the direct separation between two points. Road distance follows available roads and routes, so it is usually different and often longer.
8. What is great-circle distance?
Great-circle distance is the shortest distance along the surface of a spherical Earth between two geographic locations. It is different from the distance travelled by road or air along an actual route.
9. What are latitude and longitude?
Latitude identifies how far north or south a location is from the Equator, while longitude identifies how far east or west it is from the Prime Meridian. Together, they specify a geographic location.
10. When should I use the 2D, 3D, or Geographic Distance Calculator?
Use the 2D calculator for points on a flat coordinate plane, the 3D calculator for points with three coordinates, and the Geographic Distance Calculator for locations identified by latitude and longitude.
Disclaimer
This calculator is provided for general mathematical and educational purposes. Results depend on the coordinates, calculation method, and units entered. Geographical distance estimates may use an idealized model of Earth and may differ from actual travel distances. Verify results independently before using them for surveying, navigation, engineering, or other precision-critical applications.