Skip to main content

Coordinate Geometry

Imagine trying to describe exactly where a city sits without saying "north," "east," or giving numbers — just gesturing vaguely. That was geometry for two thousand years: shapes lived on a page, and you reasoned about them with pictures and clever constructions. Coordinate geometry changed everything by attaching numbers to every point, so that a line becomes an equation, a circle becomes a formula, and a geometry problem becomes an algebra problem you can grind out with symbols. This single idea — that space and algebra are two views of the same thing — is one of the most powerful in all of mathematics.

Once you can turn a picture into an equation and an equation back into a picture, you unlock calculus, physics, computer graphics, GPS, and machine learning. This page teaches you the core toolkit: the Cartesian plane, plotting points, distance, midpoint, slope, and the equation of a line — and, just as importantly, why each formula is what it is.

Learning Objectives

By the end of this page, you should be able to:

  • Plot and identify points on the Cartesian plane using ordered pairs (x,y)(x, y).
  • Compute the distance between two points and explain how the formula comes directly from the Pythagorean theorem.
  • Find the midpoint of a segment and interpret it as an average of coordinates.
  • Calculate the slope of a line and read off what its sign and size mean.
  • Write the equation of a line in slope-intercept and point-slope form, and move between them.
  • Translate geometric statements (parallel, perpendicular, "lies on a circle") into algebraic conditions.

Quick Answer

Coordinate geometry places every point in the plane at an address (x,y)(x, y): how far right and how far up from a fixed origin. With addresses, geometry becomes arithmetic. The distance between (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) is (x2x1)2+(y2y1)2\sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}, which is just the Pythagorean theorem applied to the horizontal and vertical gaps. The midpoint is the average of the coordinates, (x1+x22,y1+y22)\left(\frac{x_1+x_2}{2}, \frac{y_1+y_2}{2}\right). The slope measures steepness as rise over run, m=y2y1x2x1m = \frac{y_2 - y_1}{x_2 - x_1}, and a straight line is captured by y=mx+by = mx + b, where mm is the slope and bb is where it crosses the yy-axis. These few tools let you prove geometric facts by pure algebra.

Where It Came From

For most of history, algebra and geometry were separate worlds. Greek geometers like Euclid proved theorems with compass-and-straightedge diagrams and had no notion of a "graph." Algebra, developed later by scholars such as al-Khwarizmi, manipulated unknown quantities but drew no pictures. The two traditions rarely spoke to each other.

The bridge was built almost simultaneously by two French thinkers in the early 1600s. Pierre de Fermat and René Descartes, working independently, realized that if you lay down two crossing number lines — axes — then every point in the plane corresponds to a pair of numbers, and every equation in xx and yy corresponds to a curve. Descartes published the idea in an appendix, La Géométrie, to his 1637 Discourse on the Method, which is why we call the plane Cartesian after him (from the Latin form of his name, Cartesius).

Why did this matter so urgently? Because it turned hard geometry into routine algebra. A question like "where do this line and this circle meet?" — genuinely difficult with classical constructions — became "solve these two equations together." Curves that were nearly impossible to study by hand suddenly had equations you could differentiate and integrate. Within a few decades Newton and Leibniz used exactly this framework to invent calculus, and physics gained the language to describe motion, orbits, and forces. Modern computer graphics, engineering CAD, and GPS all descend from this 1637 fusion of number and shape.

The Cartesian Plane and Plotting Points

The Cartesian plane is built from two perpendicular number lines. The horizontal one is the xx-axis, the vertical one is the yy-axis, and they meet at the origin (0,0)(0, 0). Any point is named by an ordered pair (x,y)(x, y): the first number is how far you move horizontally (right if positive, left if negative), the second is how far you move vertically (up if positive, down if negative). Order matters — (3,1)(3, 1) and (1,3)(1, 3) are different points.

The axes split the plane into four quadrants, numbered counterclockwise starting from the top right:

QuadrantSign of xxSign of yyExample
I++++(2,5)(2, 5)
II-++(4,1)(-4, 1)
III--(3,2)(-3, -2)
IV++-(6,3)(6, -3)

Worked example. Plot A=(3,2)A = (-3, 2). Start at the origin, move 3 units left (because x=3x = -3), then 2 units up (because y=2y = 2). You land in Quadrant II. Now plot B=(4,1)B = (4, -1): 4 units right, then 1 unit down, landing in Quadrant IV. Getting comfortable reading points quickly is the foundation for everything else.

Distance: Pythagoras in Disguise

Suppose you want the straight-line distance between two points P=(x1,y1)P = (x_1, y_1) and Q=(x2,y2)Q = (x_2, y_2). Here is the key insight: draw a right triangle whose legs are horizontal and vertical. The horizontal leg has length x2x1|x_2 - x_1| and the vertical leg has length y2y1|y_2 - y_1|. The distance PQPQ is the hypotenuse. By the Pythagorean theorem, PQ2=(x2x1)2+(y2y1)2PQ^2 = (x_2 - x_1)^2 + (y_2 - y_1)^2, so:

d=(x2x1)2+(y2y1)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}

The squares make the sign of the differences irrelevant, so you never have to worry about which point you call "first." The distance formula is not a new fact to memorize — it is the Pythagorean theorem, wearing coordinates.

Worked example. Find the distance between P=(1,2)P = (1, 2) and Q=(4,6)Q = (4, 6).

  • Horizontal gap: x2x1=41=3x_2 - x_1 = 4 - 1 = 3.
  • Vertical gap: y2y1=62=4y_2 - y_1 = 6 - 2 = 4.
  • Then d=32+42=9+16=25=5d = \sqrt{3^2 + 4^2} = \sqrt{9 + 16} = \sqrt{25} = 5.

The points are exactly 5 units apart — the famous 3–4–5 right triangle, now living in the plane.

Midpoint: The Average Location

The midpoint of the segment joining P=(x1,y1)P = (x_1, y_1) and Q=(x2,y2)Q = (x_2, y_2) is the point exactly halfway between them. Intuitively, the halfway xx-coordinate is the average of the two xx-values, and likewise for yy:

M=(x1+x22,  y1+y22)M = \left(\frac{x_1 + x_2}{2}, \; \frac{y_1 + y_2}{2}\right)

Worked example. Find the midpoint of P=(1,2)P = (1, 2) and Q=(4,6)Q = (4, 6).

M=(1+42,2+62)=(52,4)=(2.5,4)M = \left(\frac{1+4}{2}, \frac{2+6}{2}\right) = \left(\frac{5}{2}, 4\right) = (2.5, 4)

You can sanity-check with distance: MM should be 52=2.5\frac{5}{2} = 2.5 units from each endpoint (half of the total 5). Distance from PP to MM is (2.51)2+(42)2=1.52+22=2.25+4=6.25=2.5\sqrt{(2.5-1)^2 + (4-2)^2} = \sqrt{1.5^2 + 2^2} = \sqrt{2.25 + 4} = \sqrt{6.25} = 2.5. It checks out.

Slope and the Equation of a Line

Slope measures how steep a line is: how much it rises for each unit you move right. For two points on the line,

m=riserun=y2y1x2x1m = \frac{\text{rise}}{\text{run}} = \frac{y_2 - y_1}{x_2 - x_1}

The sign tells you the direction: positive slope climbs left-to-right, negative slope descends, zero slope is flat (horizontal), and a vertical line has an undefined slope (its run is 0, so you would divide by zero). A slope of 2 2 means every step right lifts you 2 up; a slope of 13\frac{1}{3} is a gentle climb.

Once you know the slope mm and where the line crosses the yy-axis (the yy-intercept bb), the line is completely pinned down by the slope-intercept form:

y=mx+by = mx + b

If instead you know the slope and any point (x1,y1)(x_1, y_1) on the line, the point-slope form is often faster:

yy1=m(xx1)y - y_1 = m(x - x_1)

Worked example. Find the equation of the line through P=(1,2)P = (1, 2) and Q=(4,6)Q = (4, 6).

First the slope: m=6241=43m = \frac{6 - 2}{4 - 1} = \frac{4}{3}.

Now use point-slope with P=(1,2)P = (1, 2):

y2=43(x1)y - 2 = \tfrac{4}{3}(x - 1)

Expand to slope-intercept form:

y=43x43+2=43x+23y = \tfrac{4}{3}x - \tfrac{4}{3} + 2 = \tfrac{4}{3}x + \tfrac{2}{3}

So the yy-intercept is b=23b = \frac{2}{3}. Check with Q=(4,6)Q = (4,6): 43(4)+23=163+23=183=6\frac{4}{3}(4) + \frac{2}{3} = \frac{16}{3} + \frac{2}{3} = \frac{18}{3} = 6. Correct.

Connecting Shapes to Equations

The real power arrives when you translate a shape into an equation. A circle of radius rr centered at (h,k)(h, k) is the set of all points at distance rr from the center. Applying the distance formula and squaring both sides gives:

(xh)2+(yk)2=r2(x - h)^2 + (y - k)^2 = r^2

Worked example. The circle centered at (2,1)(2, -1) with radius 5 5 is (x2)2+(y+1)2=25(x-2)^2 + (y+1)^2 = 25. Does the point (5,3)(5, 3) lie on it? Substitute: (52)2+(3+1)2=9+16=25(5-2)^2 + (3+1)^2 = 9 + 16 = 25. Yes — the point is exactly on the circle. Notice we just answered a geometry question with pure arithmetic. That is the whole game.

Real-World Applications

  • GPS and navigation. Your phone locates you by treating latitude and longitude as coordinates and using distance formulas to triangulate from satellites. Map apps compute routes on a coordinate grid.
  • Computer graphics and games. Every pixel, character, and 3D model is stored as coordinates. Moving, rotating, and scaling objects on screen are algebraic operations on those coordinates.
  • Engineering and CAD. Designers specify a bridge, engine part, or circuit board as points and curves with exact coordinates so machines can manufacture them precisely.
  • Economics. Supply-and-demand graphs plot price against quantity; the market equilibrium is literally the intersection point of two lines — found by solving their equations together.
  • Physics. Position, velocity, and trajectories are described as functions in a coordinate system; a projectile's path is a parabola y=ax2+bx+cy = ax^2 + bx + c.
  • Data science. Scatter plots, regression lines (a best-fit y=mx+by = mx + b), and clustering all live in coordinate space.

Common Mistakes

  1. Reversing the coordinates. Students write (y,x)(y, x) instead of (x,y)(x, y), plotting the vertical distance first. Why it's wrong: the convention is fixed — first number horizontal, second vertical. Correction: always read the pair as "over, then up." (3,5)(3, 5) means 3 right, 5 up.

  2. Mismatching order in the slope formula. Writing m=y2y1x1x2m = \frac{y_2 - y_1}{x_1 - x_2} — subtracting the xx's in the opposite order from the yy's. Why it's wrong: this flips the sign and gives the wrong steepness direction. Correction: keep the same point "first" in both the numerator and denominator: y2y1x2x1\frac{y_2 - y_1}{x_2 - x_1}.

  3. Forgetting to square inside the distance formula. Writing d=(x2x1)+(y2y1)d = \sqrt{(x_2 - x_1) + (y_2 - y_1)} without the squares. Why it's wrong: the formula comes from Pythagoras, which requires squaring each leg. Correction: square each difference before adding, then take one square root of the sum.

  4. Confusing a slope of zero with an undefined slope. Why it's wrong: a horizontal line has slope 0 0 (equation y=cy = c); a vertical line has undefined slope (equation x=cx = c). Correction: remember "horizontal is zero, vertical is undefined" — a vertical line's run is 0 0, so its slope divides by zero.

Comparison and Connections

ConceptFormulaWhat it tells you
Distance(x2x1)2+(y2y1)2\sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}How far apart two points are
Midpoint(x1+x22,y1+y22)\left(\frac{x_1+x_2}{2}, \frac{y_1+y_2}{2}\right)The point halfway between
Slopey2y1x2x1\frac{y_2-y_1}{x_2-x_1}Steepness and direction of a line

Two useful relationships: parallel lines have equal slopes (m1=m2m_1 = m_2); perpendicular lines have slopes that are negative reciprocals (m1m2=1m_1 \cdot m_2 = -1). Distance and midpoint are easy to confuse because both involve two points — but distance subtracts and squares, while midpoint averages. Coordinate geometry also connects directly to functions: the graph of a function y=f(x)y = f(x) is just a set of coordinate points, and slope becomes the seed of the derivative in calculus.

Practice Questions

Recall

State the distance formula and the midpoint formula for points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2).

Answer: Distance =(x2x1)2+(y2y1)2= \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}; midpoint =(x1+x22,y1+y22)= \left(\frac{x_1+x_2}{2}, \frac{y_1+y_2}{2}\right).

Understanding

Explain why a vertical line has undefined slope but a horizontal line has slope zero.

Answer: On a horizontal line every point has the same yy, so the rise y2y1=0y_2 - y_1 = 0, giving m=0m = 0. On a vertical line every point has the same xx, so the run x2x1=0x_2 - x_1 = 0, and dividing by zero is undefined.

Application

Find the distance, midpoint, and slope of the line through A=(2,3)A = (-2, 3) and B=(4,1)B = (4, -1).

Answer: Distance =(4(2))2+(13)2=62+(4)2=36+16=52=213= \sqrt{(4-(-2))^2 + (-1-3)^2} = \sqrt{6^2 + (-4)^2} = \sqrt{36+16} = \sqrt{52} = 2\sqrt{13}. Midpoint =(2+42,3+(1)2)=(1,1)= \left(\frac{-2+4}{2}, \frac{3+(-1)}{2}\right) = (1, 1). Slope =134(2)=46=23= \frac{-1-3}{4-(-2)} = \frac{-4}{6} = -\frac{2}{3}.

Analysis

Three points are P=(0,0)P = (0, 0), Q=(4,0)Q = (4, 0), and R=(0,3)R = (0, 3). Show that triangle PQRPQR has a right angle at PP, then find its hypotenuse.

Answer: Slope of PQ=0040=0PQ = \frac{0-0}{4-0} = 0 (horizontal); slope of PR=3000PR = \frac{3-0}{0-0} is undefined (vertical). A horizontal and a vertical line are perpendicular, so the angle at PP is 90° 90°. The hypotenuse is QR=(04)2+(30)2=16+9=25=5QR = \sqrt{(0-4)^2 + (3-0)^2} = \sqrt{16 + 9} = \sqrt{25} = 5.

FAQ

Why is it called the "Cartesian" plane? It is named after René Descartes, whose Latinized name was Cartesius. He published the idea in 1637, and the adjective stuck — even though Fermat developed a similar system independently around the same time.

Do I have to memorize the distance formula? Not really. If you remember the Pythagorean theorem, you can rebuild the distance formula every time: the horizontal and vertical gaps are the legs of a right triangle, and the distance is the hypotenuse. Understanding beats memorizing here.

What does a negative slope look like? A line that goes downhill as you read left to right. For every step right, you move down. A slope of 2-2 drops 2 units for each unit rightward.

Can slope be a fraction? Yes, and usually is. A slope of 14\frac{1}{4} means the line rises 1 unit for every 4 units you move right — a gentle incline. Slope is any real number (except for vertical lines, where it is undefined).

How is this different from regular geometry? Classical (Euclidean) geometry reasons with diagrams, constructions, and logical proofs. Coordinate geometry assigns numbers to points so you can solve the same problems with algebra. They describe the same shapes; coordinate geometry just gives you an algebraic calculator for them.

Why does connecting algebra and geometry matter so much? Because it lets you use the strengths of both. Hard visual problems become routine equation-solving, and abstract equations gain a picture you can see. This fusion made calculus possible and underlies nearly all of modern physics and computing.

Quick Revision

  • A point is an ordered pair (x,y)(x, y): horizontal first, vertical second.
  • Quadrants run counterclockwise: I (+,+)(+,+), II (,+)(-,+), III (,)(-,-), IV (+,)(+,-).
  • Distance: d=(x2x1)2+(y2y1)2d = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2} — Pythagoras in disguise.
  • Midpoint: average the coordinates, (x1+x22,y1+y22)\left(\frac{x_1+x_2}{2}, \frac{y_1+y_2}{2}\right).
  • Slope: m=y2y1x2x1m = \frac{y_2-y_1}{x_2-x_1}; horizontal =0= 0, vertical == undefined.
  • Line: y=mx+by = mx + b (slope-intercept) or yy1=m(xx1)y - y_1 = m(x - x_1) (point-slope).
  • Circle: (xh)2+(yk)2=r2(x-h)^2 + (y-k)^2 = r^2, center (h,k)(h,k), radius rr.
  • Parallel lines: equal slopes. Perpendicular lines: slopes multiply to 1-1.

Prerequisites

Next Topics