Skip to main content
Geometry100% FreeInstant

Distance, Midpoint and Slope Calculator for Two Points

This free calculator takes two points on a plane and returns the distance between them, the midpoint, the slope, the angle of the line and the equation of the line through them.

By Debmedia Technologies LLP · Kolkata, India · Updated

What Is It and When Do You Need It?

Two points are enough to describe a straight line and the segment between them. School geometry, graphics, maps and game programming all need the distance, the midpoint and the slope of such a segment.

Enter the coordinates of both points and read every result at once, including the angle and line equation.

How to Use This Tool

  1. Enter x1 and y1 for the first point.
  2. Enter x2 and y2 for the second point.
  3. Press Calculate.
  4. Read distance, midpoint, slope, angle and equation.

How the Calculation Works

Distance = √(Δx² + Δy²), where Δx = x2 − x1 and Δy = y2 − y1. Midpoint = average of the coordinates. Slope m = Δy ÷ Δx. The line equation is y = m x + c, with c = y1 − m x1. The angle with the x axis is the arctangent of the slope.

Worked Example

For (1, 2) and (7, 10): Δx = 6 and Δy = 8, so the distance is √(36 + 64) = 10. The midpoint is (4, 6). The slope is 8 ÷ 6 = 1.3333 and the line is y = 1.3333x + 0.6667. The angle is 53.13°.

Common Uses

  • Coordinate geometry homework.
  • Distances between positions in a drawing or game.
  • Finding the centre of a line segment.
  • Checking the gradient of a ramp or road.

Tips and Common Mistakes

  • The order of the points does not change distance or slope.
  • Equal x values mean a vertical line with undefined slope.
  • Equal y values mean a horizontal line with slope 0.

Next, you may need the quadratic equation solver, Pythagorean theorem calculator, area calculator, triangle calculator.

Everything runs in your browser. Nothing you type is uploaded, stored or sent to any outside service.

Frequently Asked Questions

The distance between (x1, y1) and (x2, y2) is √((x2 − x1)² + (y2 − y1)²). It comes from the Pythagorean theorem.
The midpoint is the average of the coordinates: ((x1 + x2) ÷ 2, (y1 + y2) ÷ 2).
Slope is rise over run: (y2 − y1) ÷ (x2 − x1). A vertical line has no defined slope.
The tool gives y = mx + c, where m is the slope and c is the y-intercept. A vertical line is shown as x = a constant.

Disclaimer: results are calculated in your browser from the numbers you enter. Check important results before you rely on them for money, health, safety or legal decisions.