Skip to main content

Coordinate Geometry Basics

A fuller guide to distance and slope between points, with emphasis on plotting, sign, direction, and why coordinate formulas should still be visualised geometrically.

Key formulas

Distance formula
d = sqrt((x2 - x1)^2 + (y2 - y1)^2)
Slope formula
m = (y2 - y1) / (x2 - x1)

Coordinate formulas work best when you sketch first

A rough sketch helps you see whether two points are close or far apart, whether the line rises or falls, and whether the gradient should be steep, shallow, positive, negative, or zero. That intuition protects against sign and subtraction-order mistakes.

The formulas are compact, but they are easiest to trust when connected to the geometry. Distance is still a length in the plane, and slope is still rise over run even when written algebraically.

Distance uses a Pythagorean idea

Between points (x1, y1) and (x2, y2), the horizontal separation is x2 - x1 and the vertical separation is y2 - y1. Those form the legs of a right triangle, so the straight-line distance comes from the square root of the sum of their squares.

The squaring is important because it removes sign and turns the component changes into magnitudes. Distance is never negative, even if one coordinate difference is.

Slope keeps direction visible

Slope is vertical change divided by horizontal change. A positive slope rises to the right, a negative slope falls to the right, zero slope is horizontal, and undefined slope corresponds to a vertical line where the horizontal change is zero.

Because both numerator and denominator matter, subtraction order must stay consistent. If you compute y2 - y1 on top, pair it with x2 - x1 on the bottom. Changing only one order flips the sign incorrectly.

  • Positive slope: line rises left to right.
  • Negative slope: line falls left to right.
  • Zero slope: horizontal line.
  • Undefined slope: vertical line.

Worked examples

Example 1: Between (1, 2) and (5, 5), the horizontal change is 4 and the vertical change is 3, so the distance is 5 and the slope is 3/4.

Example 2: Between (-2, 4) and (3, -1), the vertical change is -5 and the horizontal change is 5, so the slope is -1. The negative sign matches the visual fall from left to right.

Example 3: Points with the same x-coordinate form a vertical line, so the slope is undefined even though the distance can still be found normally.

Common mistakes and checks

If your computed slope says the line rises but your sketch clearly falls, trust the sketch and re-check the subtraction order.
  • Mixing subtraction order in the slope formula.
  • Forgetting to square coordinate differences in the distance formula.
  • Calling a vertical line a very large slope rather than an undefined one.
  • Skipping the sketch and therefore missing an obviously wrong sign.
Related calculators

Apply the topic straight away.