Skip to main content
Calcimator

Coordinate Distance Calculator

Calculate the distance between two points on a coordinate plane, plus midpoint, slope, and the distance formula breakdown.

About this calculator

Given two points on a coordinate plane, this calculator finds the straight-line distance between them using the Euclidean distance formula — the square root of the squared horizontal gap plus the squared vertical gap — which is really the Pythagorean theorem applied to a coordinate grid instead of a physical triangle. At the calculator's default points, (0, 0) and (3, 4), the horizontal and vertical gaps form a 3-4-5 right triangle, and Y₂ has noticeably more pull over the resulting distance than X₂ does — nudging Y₂ by ten percent moves the distance by roughly 1.8 times the proportional amount that nudging X₂ by the same ten percent does, because the vertical gap (4) makes up a larger share of the total distance (5) than the horizontal gap (3) does. X₁ and Y₁ start at exactly 0 by default, which means this calculator's own starting example cannot demonstrate how those two fields move the distance — a coordinate that is already zero has nothing to be nudged by a percentage of itself.

The midpoint's X coordinate depends only on X₁ and X₂, never on either Y value, and the midpoint's Y coordinate depends only on Y₁ and Y₂ in exactly the same mirrored way. Missing from this calculator: slope is reported as literal undefined text rather than a number whenever the two X coordinates are identical, since a vertical line segment has no finite rise-over-run ratio to display.

Inputs

Results

Distance

5

Midpoint X1.5
Midpoint Y2
Slope1.3333
Formula√((3-0)² + (4-0)²) = 5
How to Use This Calculator
  1. Enter the coordinates of the two points: (x₁, y₁) and (x₂, y₂).
  2. Distance is computed using the Euclidean formula: d = √((x₂−x₁)² + (y₂−y₁)²), which is the Pythagorean theorem applied to coordinate geometry.
  3. Midpoint coordinates are ((x₁+x₂)/2, (y₁+y₂)/2) — the exact center of the segment.
  4. Slope of the line segment is (y₂−y₁)/(x₂−x₁); vertical lines (x₁=x₂) have undefined slope.
  5. Coordinates can be positive or negative; all real number inputs are supported.

How the result changes with Y₂

Y₂Distance
23.6056
34.2426
66.7082
1010.4403

What each input means

X₁
X-coordinate of the first point.
Y₁
Y-coordinate of the first point.
X₂
X-coordinate of the second point.
Y₂
Y-coordinate of the second point.

How this is calculated

Worked example, using the default values

  1. Identify Input Parameters
    4 parameters
    X₁ = 0, Y₁ = 0, X₂ = 3, Y₂ = 4 = 4 input(s) provided
  2. Calculate Distance
    Distance
    5 = 5
  3. Calculate Midpoint X
    Midpoint X
    1.5 = 1.5
  4. Calculate Midpoint Y
    Midpoint Y
    2 = 2

Engine last updated . Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.

Frequently Asked Questions

Why does Y₂ move the distance more than X₂ does at the default points?

At the default points (0, 0) and (3, 4), the vertical gap of 4 makes up four-fifths of the total distance of 5, while the horizontal gap of 3 makes up three-fifths. A coordinate's pull on the overall distance scales with how large a share of that distance its own gap represents, so the larger gap — here, the vertical one driven by Y₂ — swings the result by more for an equivalent percentage nudge.

Why can't the calculator show how X₁ and Y₁ affect the distance at the default settings?

Both fields start at exactly 0 by default, and a percentage-based nudge of a value that is already zero is still zero — there's nothing to scale. Change either field away from 0 first, and its influence on the distance becomes measurable and real, just like X₂ and Y₂ already are at their non-zero defaults.

Does the midpoint's X coordinate depend on the Y values at all?

No. The midpoint's X coordinate is calculated purely as the average of X₁ and X₂ — the two added together and divided by 2 — with no reference anywhere in that formula to either Y value. The same separation holds in reverse for the midpoint's Y coordinate, which depends only on Y₁ and Y₂.

Why does the slope show as text instead of a number sometimes?

Slope is the vertical gap divided by the horizontal gap, and division by zero has no finite answer. Whenever X₁ and X₂ are equal, the horizontal gap is exactly zero, which describes a perfectly vertical line segment with no defined slope, so the calculator displays the word undefined instead of an invalid or infinite-looking number.

The questions that sit next to this one — chosen by subject, including calculators filed under a different category.

More in Math & Statistics.