Sign up

Distance & Midpoint

Find the distance between two points (x₁,y₁) and (x₂,y₂).

Coordinate Inputs

Enter the x and y coordinates for both points.

Distance —
Midpoint —
Slope —

Enter valid coordinates to view the analysis.

About this topic

Distance Formula The straight-line distance between two points.

The distance formula is derived from the Pythagorean theorem. It measures the length of the straight line segment that connects two points in a coordinate plane.

Key formulas & rules

  • •Formula: d = √((x₂ − x₁)² + (y₂ − y₁)²)
  • •Also written: d = √(Δx² + Δy²)
  • •Always non-negative: d ≥ 0
  • •d = 0 if and only if the points are identical
  • •Derived from Pythagoras with legs Δx and Δy
  • •Extends to 3D: d = √(Δx² + Δy² + Δz²)

Examples

Input Output Note
(0,0) → (3,4) 5 Pythagorean triple
(1,1) → (4,5) 5 Same distance, shifted
(-2,-3) → (2,1) 5.657 √32
(0,0) → (1,1) 1.414 √2

Real-world uses

GPS navigation Robotics path planning Game physics
Midpoint Formula The point exactly halfway between two others.

The midpoint is found by averaging the x and y coordinates of the two endpoints. It lies exactly at the center of the line segment connecting them.

Key formulas & rules

  • •Formula: M = ((x₁ + x₂)/2, (y₁ + y₂)/2)
  • •Midpoint divides the segment into two equal halves
  • •Distance from M to each endpoint is d/2
  • •Works in 2D and 3D (average all coordinates)
  • •Midpoint of the diagonal of a rectangle = center
  • •Special case: segment bisector

Examples

Input Output Note
(0,0) & (4,6) (2, 3) Simple average
(-5,-2) & (4,3) (-0.5, 0.5) Negative coord
(3,4) & (7,10) (5, 7) Both positive
(2,-8) & (-6,4) (-2, -2) Across axes

Real-world uses

Map center finding Symmetry detection CAD software
Slope of the Line The rise-over-run between two points.

The slope measures how steeply the line between two points rises or falls. It's a critical value for understanding the linear relationship between coordinates.

Key formulas & rules

  • •Formula: m = (y₂ − y₁) / (x₂ − x₁)
  • •Horizontal line: m = 0
  • •Vertical line: m is undefined (÷ by 0)
  • •Positive m → rises left-to-right
  • •Negative m → falls left-to-right
  • •Slope = tan(θ) where θ is the angle from the x-axis

Examples

Input Output Note
(0,0) → (2,4) m = 2 Steep up
(0,4) → (2,0) m = -2 Steep down
(1,1) → (5,1) m = 0 Horizontal
(3,0) → (3,5) Undefined Vertical

Real-world uses

Road grade calculations Rate of change Data trend analysis
Real-World Uses Where these formulas solve real problems.

Distance, midpoint, and slope appear throughout modern technology — from the games you play to the maps you use. They form the geometric backbone of any system dealing with 2D or 3D coordinates.

Key formulas & rules

  • •Distance: satellite ↔ receiver GPS triangulation
  • •Midpoint: finding map centers, dividing routes
  • •Slope: road grade, ramp angles, roof pitch
  • •Distance: collision detection in games
  • •Midpoint: symmetry detection in images
  • •Slope: trend lines in data science

Examples

Input Output Note
GPS fix Distance via triangulation Satellite system
Video game Collision distance check Every frame
Data science Slope of regression line Trend analysis
Architecture Roof pitch Slope application

Real-world uses

Navigation apps CAD & GIS software Machine learning

Modes & formulas

1

Distance & Midpoint

• Calculates the straight-line distance and halfway point between two coordinates. • Enter (x1, y1) and (x2, y2). • The calculator uses the distance formula and averages the coordinates for the midpoint.
d = √((x₂ - x₁)² + (y₂ - y₁)²)

The distance formula creates a right triangle with legs Δx and Δy, making the distance the hypotenuse. The midpoint is simply the average of the x's and y's.

2

Slope

• Finds the steepness of the line connecting the two points. • The calculator calculates the change in Y (rise) over the change in X (run). • It handles vertical lines as 'Undefined'.
m = (y₂ - y₁) / (x₂ - x₁)

If the x-coordinates are the same, the line is vertical, and the slope is undefined (division by zero).

How to use it

Enter the coordinates of two points. The tool displays the distance, midpoint, slope, and an interactive graph of the points.

Frequently asked questions

What is the midpoint?
The exact center point of the line segment connecting the two coordinates.
Why is the slope of a vertical line undefined?
The formula divides by Δx = 0, and division by zero is undefined in mathematics.
What is the distance formula?
d = √((x₂ - x₁)² + (y₂ - y₁)²). It calculates the length of the straight line connecting two coordinates.
What is the midpoint formula?
M = ((x₁ + x₂)/2, (y₁ + y₂)/2). It finds the exact center point between two coordinates by averaging them.
What is the slope formula?
m = (y₂ - y₁) / (x₂ - x₁). It measures the steepness and direction of a line (rise over run).
What does a negative slope mean?
It means the line goes downwards from left to right (as X increases, Y decreases).

Related calculators

Read the full Distance & Midpoint guide — examples & 18 FAQs