Coordinate Geometry

Geometry · about 3 min read · updated October 2026

Coordinate geometry, often called analytic geometry, translates shapes into numbers. By placing points on a grid of $x$ and $y$ values, questions about distance, direction, and midpoints become arithmetic rather than drawing.

The two skills worth mastering first are finding the distance between any two points and finding the point halfway between them. Together they underpin nearly everything that follows, from the equation of a line to the proof of the Pythagorean theorem.

Distance and midpoint between two points
Distance and midpoint between two points

Distance Between Two Points

Given points $A(x_1, y_1)$ and $B(x_2, y_2)$, the horizontal gap is $\Delta x = x_2 - x_1$ and the vertical gap is $\Delta y = y_2 - y_1$. Those two gaps form the legs of a right triangle with the segment $AB$ as hypotenuse, so the Pythagorean theorem immediately gives the distance formula:

$$ d = \sqrt{(\Delta x)^{2} + (\Delta y)^{2}} $$

Worked example. Find the distance between $A(1, 2)$ and $B(7, 8)$.

$$ d = \sqrt{(7-1)^{2} + (8-2)^{2}} = \sqrt{36 + 36} = \sqrt{72} = 6\sqrt{2} \approx 8.49 $$

Notice how the distance formula and the Pythagorean theorem are the same idea in different clothing. This is not a coincidence: analytic geometry simply re-expresses geometric facts using coordinates.

Midpoint

The midpoint is the average of the coordinates, taken component by component:

$$ M = \left(\frac{x_1+x_2}{2},\ \frac{y_1+y_2}{2}\right) $$

For the same points $A(1, 2)$ and $B(7, 8)$, the midpoint is

$$ M = \left(\frac{1+7}{2},\ \frac{2+8}{2}\right) = (4, 5) $$

Averaging is much quicker than measuring, and it works regardless of where the points sit in the plane.

Slope

The slope of a line measures steepness and is written $m$:

$$ m = \frac{\Delta y}{\Delta x} = \frac{y_2 - y_1}{x_2 - x_1} $$

A positive slope rises from left to right, a negative slope falls, and a slope of zero describes a horizontal line. A vertical line has no defined slope because $\Delta x = 0$.

Combining slope with a point gives the point-slope form of a line:

$$ y - y_1 = m(x - x_1) $$

which rearranges into the familiar $y = mx + b$.

Common Mistakes to Watch For

The most frequent slip is forgetting the square root in the distance formula, which returns the squared distance instead. A second error is subtracting coordinates in inconsistent order — if you compute $x_2 - x_1$, you must also compute $y_2 - y_1$, though squaring makes the final distance harmless either way. A third mistake is inverting slope: rise over run means the vertical change goes on top.

Equations of a Line in Practice

Once a slope and a point are known, the equation follows mechanically. Suppose a line passes through $(2, 3)$ with slope $4$. Substituting into point-slope form gives

$$ y - 3 = 4(x - 2) $$

which expands to $y = 4x - 5$. The number $-5$ is where the line crosses the vertical axis, and it completes the picture just as the slope describes the tilt. Two lines in the plane are parallel precisely when their slopes are equal, and they are perpendicular when their slopes multiply to $-1$, provided neither is vertical.

Working the other way round is just as common: given an equation such as $2x + 3y = 12$, rewrite it as $y = -\tfrac{2}{3}x + 4$ to read off a slope of $-\tfrac{2}{3}$ and an intercept of $4$. Getting comfortable in both directions is the real goal.

Classifying Shapes on the Grid

Coordinates let you name a shape rather than merely sketch it. With four points $A$, $B$, $C$, and $D$, compute the four side slopes and compare them. Equal opposite slopes mean parallel sides, which points toward a parallelogram. A slope of zero paired with an undefined slope signals a right angle. Applying the distance formula to all four sides then tells you whether the figure is a rectangle, a rhombus, or a square, because those hinge entirely on whether the side lengths are equal.

Key takeaway: build every formula from right triangles and averages, and check the units and sign of your slope before continuing.

Practice it: try the equation solver or generate a practice set on this topic.

More geometry guides