Distance Tool

Find distances in two-dimensional and three-dimensional space using Euclidean, Manhattan or Chebyshev metrics. Measure great-circle distances between geographic coordinates or the shortest distance from a point to a line, segment or ray, with visual diagrams and detailed results.

Point A
Point B

Coordinates and results use the same selected unit.

Straight-line distance
10.000 u
√[(8 − 2)² + (11 − 3)²]
Coordinate planeDrag A or B to adjust
Loading diagram…
Measurements
Calculation breakdown

Table of Contents

  1. How Distance Tool Works?
  2. Practical Use Cases
  3. Accuracy and Limitations
  4. Frequently Asked Questions (FAQs)
  5. Cite This tool

Highlights

  • 2D and 3D point-to-point distance calculations
  • Euclidean, Manhattan and Chebyshev distance options
  • Great-circle distances with bearings and Earth radius choices
  • Shortest distance to infinite lines, segments and rays
  • Interactive coordinate diagram, detailed breakdowns and CSV, JSON, SVG or PNG exports

How Distance Tool Works?

For two points, subtract corresponding coordinates to obtain the differences along each axis. In two dimensions, the Euclidean distance follows Pythagoras; in three dimensions, it includes the difference in height or depth.

d=(x2−x1)2+(y2−y1)2+(z2−z1)2

In the two-dimensional case, omit the z term. Two alternative distance measures are Manhattan distance, which adds absolute coordinate differences, and Chebyshev distance, which takes the largest absolute difference.


MetricHow distance is measured
EuclideanSquare root of the sum of squared axis differences
ManhattanSum of absolute axis differences
ChebyshevLargest absolute axis difference

For two latitude–longitude positions, the haversine formula finds the central angle between them on a spherical Earth. Great-circle distance equals that angle, in radians, multiplied by the selected Earth radius (mean, equatorial or polar). The results also include initial and final bearings and the central angle.

d=2R⁢atan2(a,1−a)

For point-to-line distance, project point P onto the direction from A to B to find the nearest point Q, then measure the Euclidean distance from P to Q. The projection is unrestricted for an infinite line, limited to the interval from A to B for a segment, or restricted to the forward direction for a ray. The output includes Q, the projection factor and the reference segment length.

Practical Use Cases

Students and teachers: Explore coordinate geometry, midpoint, slope and direction while comparing straight-line, Manhattan and Chebyshev distances in two or three dimensions.

CAD designers and engineers: Check spatial separation between specified 3D points and measure the shortest distance from a point to an infinite line, finite segment or ray.

GIS analysts and geography students: Estimate great-circle distances and initial or final bearings between latitude–longitude locations using a selected spherical Earth radius.

Game developers: Compare Euclidean, Manhattan and Chebyshev distances for movement rules, proximity checks and grid-based path heuristics.

Surveying and drawing users: Locate the nearest point on a drawn line or segment and inspect the projection factor to see whether the closest position is within the endpoints.

Accuracy and Limitations

Coordinate calculations use JavaScript floating-point arithmetic and display 2, 3, 4, 6 or 8 decimal places, so rounding affects the shown values. Coordinate inputs are limited to magnitudes of one trillion. Geographic distances use a spherical haversine model with a selectable mean, equatorial or polar radius, not an ellipsoidal geodesic or a road route; bearings can be ambiguous at coincident or antipodal points. Point-to-line calculations require distinct endpoints A and B. The 3D diagram is an illustrative projection, and the latitude–longitude diagram does not trace the actual great-circle route on a map.

Frequently Asked Questions

Euclidean distance measures the straight-line separation between points. Manhattan distance adds the absolute changes along each coordinate axis.

Chebyshev distance is the largest absolute change along any single axis. It is useful when diagonal movement can cover changes on multiple axes in one step.

A great-circle route is the shortest path along the surface of a perfect sphere. On Earth, it provides a useful approximation for long-distance travel.

For an infinite straight line, the shortest distance is along a perpendicular. For a finite segment, the nearest point may instead be an endpoint.

The initial bearing is the direction at the starting location; the final bearing is the direction on arrival. They can differ because a great-circle route curves across lines of longitude.

Cite This tool