ThisCalculator

Everyday

Displacement Calculator for Distance: How It Works

Updated · Standard formula, shown below

Displacement 5.00 m
Direction angle
53.1 degrees
Result
Start X
0 m
You entered
Start Y
0 m
You entered

This displacement calculator works out the straight-line distance between a starting point and an ending point when you know the coordinates of both. You enter the x and y coordinates (or latitude/longitude in decimal degrees) and the calculator returns the displacement in the same units you used, along with the direction angle if you need it. Displacement is not the same as total distance traveled—it is the shortest path between two points, ignoring any route you took in between.

Formula

The displacement between two points in a plane is given by the Euclidean distance formula:

d = √((x₂ − x₁)² + (y₂ − y₁)²)

Where:

  • d = displacement (same unit as the coordinates, e.g., meters, feet, km)
  • x₁, y₁ = coordinates of the starting point
  • x₂, y₂ = coordinates of the ending point

The direction angle (if you want it) is calculated with the inverse tangent function: θ = atan2(y₂ − y₁, x₂ − x₁), given in degrees from the positive x-axis.

Worked Example

Using the default values from the calculator: start at (0, 0) and end at (3, 4), both in meters.

  1. Find the difference in x: 3 − 0 = 3 m
  2. Find the difference in y: 4 − 0 = 4 m
  3. Square each difference: 3² = 9, 4² = 16
  4. Add them: 9 + 16 = 25
  5. Take the square root: √25 = 5 m

The displacement is 5 meters. The direction angle is atan2(4, 3) ≈ 53.1° from the positive x-axis.

When to Use Displacement vs. Distance

Use displacement when you need the net change in position—for example, in physics problems about velocity, in navigation when you want the straight-line bearing to a destination, or in surveying to find the gap between two surveyed points. Use total distance when you care about the actual path length, like fuel consumption or hiking trail length. A car trip from home to work and back has a total distance of, say, 20 km, but the displacement is 0 because you end where you started.

How to Choose Your Coordinate System

The calculator works with any consistent coordinate system. For flat maps, use projected coordinates like UTM (in meters) or state plane coordinates. For global positions, use latitude and longitude in decimal degrees—but note that this calculator treats them as flat x/y coordinates, which is only accurate for small areas (a few kilometers). For larger distances on Earth’s surface, you need the haversine formula, which accounts for the curvature of the planet. If you enter latitude and longitude, the result will be in degrees, not kilometers, unless you convert.

Common Mistakes and Misconceptions

  • Mixing units: If x is in meters and y is in feet, the result is meaningless. Always convert to the same unit first.
  • Confusing displacement with distance traveled: Displacement is always the shortest straight line; distance traveled can be any length.
  • Ignoring the direction: Displacement is a vector—it has both magnitude and direction. The calculator gives you the magnitude; the angle gives you the direction.
  • Using degrees without conversion: For latitude/longitude, one degree of latitude is about 111 km, but one degree of longitude varies with latitude. This flat formula does not account for that.

Limits of the Formula

The Euclidean formula assumes a flat, two-dimensional plane. It is perfectly accurate for small areas like a room, a building site, or a city block. For distances over about 10 km on the Earth’s surface, the curvature becomes noticeable, and the straight-line distance through the Earth (chord) differs from the surface distance. If you need the surface distance on a sphere, use the haversine formula or a geodesic calculator. Also, the formula gives the shortest distance, not the actual driving or walking route—roads rarely follow straight lines.

Frequently Asked Questions

What is the difference between displacement and distance?

Distance is the total length of the path traveled, regardless of direction. Displacement is the straight-line length from the start point to the end point, including direction. If you walk 3 m north, then 4 m east, you have traveled 7 m, but your displacement is 5 m northeast.

Can I use this calculator for latitude and longitude?

Only for very small areas where the Earth’s curvature is negligible. For example, within a few hundred meters, treating lat/lon as flat coordinates gives a rough estimate, but the result will be in degrees, not meters. For accurate global distances, use a haversine calculator.

What if my coordinates are negative?

Negative coordinates are fine—they just indicate positions in the negative x or y direction. The formula works with any real numbers. For example, start at (-2, 3) and end at (4, -1) gives a displacement of √((4-(-2))² + (-1-3)²) = √(36 + 16) = √52 ≈ 7.21 units.

How do I calculate displacement if I only know the distance traveled and direction?

If you move in a straight line, displacement equals distance. If you move in multiple segments, you need to break each segment into x and y components (using sine and cosine of the direction angles), sum the components, then use the formula. For example, moving 10 m at 30° gives x = 10·cos(30°) ≈ 8.66 m, y = 10·sin(30°) = 5 m.

What units should I use?

Use any unit you like, as long as you use the same unit for all four coordinates. Common choices are meters, feet, kilometers, or miles. The result will be in that same unit. If you need the direction angle, it is always in degrees, independent of the length unit.

Is displacement always positive?

The magnitude of displacement (the number the calculator gives) is always non-negative because it is a square root of a sum of squares. However, the x and y components can be negative, and the direction angle can be any value from -180° to 180°. For example, moving left from the start gives a negative x component.

Related

Formula used
in x1 | Start X | m | 0 | 0
in y1 | Start Y | m | 0 | 0
in x2 | End X | m | 3 | 0
in y2 | End Y | m | 4 | 0
out d | Displacement | m | sqrt((x2-x1)^2 + (y2-y1)^2) | 2
out angle | Direction angle | degrees | atan2(y2-y1, x2-x1)*180/pi | 1

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.