Coordinate Geometry: Formulas Concepts and Worked Examples

#Coordinate Geometry
TL;DR
Coordinate geometry gives every point an address (x,y)(x, y) on a grid, so geometric questions become arithmetic. Four formulas carry most of it: distance, midpoint, slope and section, each a short calculation on two points.
Shikha Sharma·reviewed byMadhukar VLast updated on December 2, 202613 min read

Key Points

  • A point is an ordered pair (x,y)(x, y). The axes cross at the origin (0,0)(0, 0) and make four quadrants.
  • Distance: d=(x2−x1)2+(y2−y1)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}, Pythagoras on the run and the rise.
  • Midpoint: (x1+x22,y1+y22)\left(\frac{x_1 + x_2}{2}, \frac{y_1 + y_2}{2}\right), the average of each coordinate.
  • Slope: m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}, rise over run; undefined for a vertical line.
  • Section formula: the point dividing a segment in the ratio m:nm : n; the midpoint is the 1:11 : 1 case.

Why Turn Shapes Into Numbers?

A computer cannot look at a triangle, yet it measures thousands of them every second. It can only store numbers.

  • Map apps, drawing programs and games store each corner as a pair of numbers.
  • Every question (how long, how steep, where is the middle) is then answered by arithmetic.

That trade, pictures for numbers, is coordinate geometry. It dates from the 1630s, and it is why a curve can be written as an equation.

What Is Coordinate Geometry?

Coordinate geometry (also called analytic geometry) studies points, lines and shapes using coordinates: each point is an ordered pair (x,y)(x, y) saying how far across and up it is from a fixed origin.

  • The grid is the Cartesian plane: an xx-axis and a yy-axis crossing at the origin O(0,0)O(0, 0).
  • Used as a space for plotting, it is called the coordinate plane.
  • Once points are numbers, distances become subtractions, midpoints become averages and steepness becomes a ratio.
  • The pair is ordered: (3,2)(3, 2) and (2,3)(2, 3) are different points. The xx-coordinate always comes first.

The Quadrants and Sign Patterns

The axes cut the plane into four quadrants, numbered anticlockwise from the top right. Each has a fixed sign pattern:

Quadrant xx yy Example
I ++ ++ (3,2)(3, 2)
II −- ++ (−3,2)(-3, 2)
III −- −- (−3,−2)(-3, -2)
IV ++ −- (3,−2)(3, -2)
  • A point with a zero coordinate, such as (4,0)(4, 0), sits on an axis and belongs to no quadrant.
  • A point in the wrong quadrant is a quick sign that a minus sign went wrong.
the coordinate plane, its four quadrants and their sign patterns
The coordinate plane with the origin O(0, 0), the points (3, 2), (−3, 2), (−3, −2) and (3, −2) in quadrants I to IV with their sign patterns, and (4, 0) sitting on the x-axis.

The Core Coordinate Geometry Formulas

For two points A(x1,y1)A(x_1, y_1) and B(x2,y2)B(x_2, y_2), four formulas answer four questions. The running example is A(−3,−3)A(-3, -3) and B(1,0)B(1, 0), the tool's starting position.

Question Formula For A(−3,−3)A(-3, -3), B(1,0)B(1, 0)
How far apart? d=(x2−x1)2+(y2−y1)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} 42+32=5\sqrt{4^2 + 3^2} = 5
Where is the middle? M=(x1+x22,y1+y22)M = \left(\frac{x_1 + x_2}{2}, \frac{y_1 + y_2}{2}\right) (−1,−1.5)(-1, -1.5)
How steep? m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1} 34\frac{3}{4}
Which point splits it m:nm : n? (mx2+nx1m+n,my2+ny1m+n)\left(\frac{mx_2 + nx_1}{m + n}, \frac{my_2 + ny_1}{m + n}\right) 1:11 : 1 gives MM again

The run x2−x1=4x_2 - x_1 = 4 and the rise y2−y1=3y_2 - y_1 = 3 do most of the work.

in coordinate geometry one pair of points gives the distance, the midpoint and the slope
The points A(−3, −3) and B(1, 0) joined by an orange segment, with a blue run of 4, a green rise of 3, the distance 5, the purple midpoint M(−1, −1.5) and the dashed line through them with slope 3/4.

Distance Formula: "How Far Apart?"

d=(x2−x1)2+(y2−y1)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}
  • The distance formula is the Pythagorean theorem. The run and rise are the legs of a right triangle, and ABAB is its hypotenuse.
  • So AB=42+32=5AB = \sqrt{4^2 + 3^2} = 5.
  • Squaring removes minus signs, so it does not matter which point comes first.
  • The distance between two points article adds the 3D version.

Midpoint Formula: "What's the Centre?"

M=(x1+x22,y1+y22)M = \left(\frac{x_1 + x_2}{2}, \frac{y_1 + y_2}{2}\right)
  • The midpoint formula averages the two xx-values and the two yy-values.
  • Why: from AA to BB is 4 across and 3 up. Halfway is 2 across and 1.5 up, landing at (−1,−1.5)(-1, -1.5).
  • Across and up do not affect each other, so the middle is halfway in each, separately.
the midpoint is halfway across and halfway up, separately
The segment from P(−2, 3) to Q(6, 7) with its midpoint M(2, 5), and dashed lines down to the x-axis and across to the y-axis showing that 2 is halfway from −2 to 6 and 5 is halfway from 3 to 7.

Slope Formula: "How Steep?"

m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}
  • The slope is rise over run: vertical change over horizontal change.
  • Any two points on a straight line make a right triangle. These triangles are all similar, so the ratio is always the same.
  • A curve fails this test, which is how you can tell it is not a straight line.

Section Formula: "What Divides It in a Ratio?"

A point dividing AA to BB in the ratio m:nm : n is

(mx2+nx1m+n,my2+ny1m+n)\left(\frac{m x_2 + n x_1}{m + n}, \frac{m y_2 + n y_1}{m + n}\right)

This section formula is a weighted average. The midpoint is the 1:11 : 1 case.

  • Drag AA and BB. The blue run, green rise and orange distance show Pythagoras live; the purple dot is MM.
  • Press "Show me: squares on the sides" to see 16 and 9 make 25.
  • Try "Horizontal" (slope 0) and "Vertical" (slope undefined).

Try It Yourself

Try the tool:

Edge Cases Worth Knowing

Most errors happen where a formula meets a zero.

  • Vertical lines: the run is 0, so the slope is undefined. The equation is x=constantx = \text{constant}.
  • Horizontal lines: the rise is 0, so the slope is 0. The equation is y=constanty = \text{constant}.
  • The same point twice: distance 0, and the slope is undefined, because one point does not fix a line.
  • Axes in different units: on a km-against-hours graph, the distance formula means nothing. The slope still works: it is a speed.

Proving Geometry With Coordinates

Once points are numbers, a geometry fact can be proved by calculation.

Take parallelogram OABCOABC with O(0,0)O(0, 0), A(5,0)A(5, 0), B(7,3)B(7, 3) and C(2,3)C(2, 3).

  • Midpoint of OBOB: (0+72,0+32)=(3.5,1.5)\left(\frac{0 + 7}{2}, \frac{0 + 3}{2}\right) = (3.5, 1.5).
  • Midpoint of ACAC: (5+22,0+32)=(3.5,1.5)\left(\frac{5 + 2}{2}, \frac{0 + 3}{2}\right) = (3.5, 1.5).
  • Same point, so the diagonals bisect each other.
coordinates prove that the diagonals of a parallelogram bisect each other
A parallelogram with vertices O(0, 0), A(5, 0), B(7, 3) and C(2, 3), its orange and green diagonals crossing at (3.5, 1.5), with tick marks showing each diagonal cut into equal halves.
  • To prove it for every parallelogram, use letters: O(0,0)O(0, 0), A(a,0)A(a, 0), B(a+b,c)B(a + b, c), C(b,c)C(b, c). Both midpoints are (a+b2,c2)\left(\frac{a + b}{2}, \frac{c}{2}\right).
  • Collinear points: equal slopes. For (1,2)(1, 2), (3,6)(3, 6) and (4,8)(4, 8) both slopes are 2, so they are collinear.
  • Parallel lines have equal slopes. Perpendicular lines have slopes that multiply to −1-1 (unless one is vertical).
  • A circle is the distance formula in disguise: (x−h)2+(y−k)2=r2(x - h)^2 + (y - k)^2 = r^2.

Examples of Coordinate Geometry

The examples move from one formula at a time to combining several, ending with a real layout.

Example 1

Find the distance between A(−3, −3) and B(1, 0).

  1. Run: 1−(−3)=41 - (-3) = 4. Rise: 0−(−3)=30 - (-3) = 3.
  2. d=42+32=25d = \sqrt{4^2 + 3^2} = \sqrt{25}.

Final answer: 5 units.

Example 2

Find the midpoint of (−2, 3) and (6, 7).

  1. Do not subtract: (8,4)(8, 4) lies beyond both endpoints, so it cannot be the middle.
  2. Average instead: (−2+62,3+72)=(42,102)\left(\frac{-2 + 6}{2}, \frac{3 + 7}{2}\right) = \left(\frac{4}{2}, \frac{10}{2}\right).

Final answer: (2,5)(2, 5).

Example 3

Find the slope of the line through (2, 1) and (5, 7).

  1. m=7−15−2=63m = \frac{7 - 1}{5 - 2} = \frac{6}{3}.

Final answer: 2. The line rises 2 units for every 1 unit right.

Example 4

Find P dividing A(2, 3) to B(8, 9) in the ratio 1 : 2.

  1. Use m=1m = 1, n=2n = 2: P=(1⋅8+2⋅23,1⋅9+2⋅33)P = \left(\frac{1 \cdot 8 + 2 \cdot 2}{3}, \frac{1 \cdot 9 + 2 \cdot 3}{3}\right).
  2. P=(123,153)P = \left(\frac{12}{3}, \frac{15}{3}\right).

Final answer: P=(4,5)P = (4, 5), one-third of the way from AA. The internal division article explains why mm multiplies the far point.

the section formula finds the point dividing AB in the ratio 1 to 2
The segment from A(2, 3) to B(8, 9) cut into three equal parts by tick marks, with P(4, 5) after the first part: one part orange, two parts blue.

Example 5

Show that (0, 0), (4, 0) and (2, 3) form an isosceles triangle.

  1. (0,0)(0, 0) to (4,0)(4, 0): 42+02=4\sqrt{4^2 + 0^2} = 4.
  2. (0,0)(0, 0) to (2,3)(2, 3): 22+32=13\sqrt{2^2 + 3^2} = \sqrt{13}.
  3. (4,0)(4, 0) to (2,3)(2, 3): (2−4)2+32=13\sqrt{(2 - 4)^2 + 3^2} = \sqrt{13}.

Final answer: Two sides equal 13\sqrt{13}, so it is isosceles.

the distance formula shows the triangle has two equal sides
A triangle with corners (0, 0), (4, 0) and (2, 3); the base is 4 and the two slanted sides are each √13, marked with matching ticks.

Example 6

A park has corners (0, 0), (60, 0), (60, 40) and (0, 40), in metres. A lamp post is at the centre. Where is it, and how far from a corner?

  1. Centre = midpoint of a diagonal: (0+602,0+402)=(30,20)\left(\frac{0 + 60}{2}, \frac{0 + 40}{2}\right) = (30, 20).
  2. Distance to (0,0)(0, 0): 302+202=1300\sqrt{30^2 + 20^2} = \sqrt{1300}.

Final answer: At (30,20)(30, 20), about 36.1 m from each corner. Surveyors lay out real sites with these same two formulas.

Common Mistakes With Coordinate Geometry

These errors come up the moment several formulas are in play at once.

Mistake 1: Subtracting in the midpoint formula

Where it slips in: Straight after distance and slope, which both subtract.

Don't do this: Write the midpoint of (−2,3)(-2, 3) and (6,7)(6, 7) as (8,4)(8, 4).

The correct way: Ask "a gap or a place?" Gaps subtract; the midpoint is a place, so add and halve.

Mistake 2: Mixing the order in the slope formula

Where it slips in: Taking "bigger minus smaller" out of habit.

Don't do this: Compute y2−y1x1−x2\frac{y_2 - y_1}{x_1 - x_2}, which gives −2-2 for (2,1)(2, 1) and (5,7)(5, 7).

The correct way: The point first on top goes first underneath. 7−15−2=2\frac{7 - 1}{5 - 2} = 2.

Mistake 3: Dropping the squares in the distance formula

Where it slips in: Remembering it as "the root of the differences".

Don't do this: Write 4+3=7\sqrt{4 + 3} = \sqrt{7}.

The correct way: Square first, then add: 16+9=5\sqrt{16 + 9} = 5. Route planners face the same trap: diagonal travel is never just the sum of the two gaps.

Mistake 4: Trusting a picture instead of the numbers

Where it slips in: A sketch that looks square or straight.

Don't do this: Call four points a square because the drawing looks square.

The correct way: Check with formulas: equal sides and diagonals, slopes multiplying to −1-1, equal slopes.

Why Coordinate Geometry Matters: "When Descartes Put Algebra on a Map"

With the formulas, proofs and pitfalls in hand, the reason the subject exists comes into focus. René Descartes introduced coordinate geometry in La Géométrie (Leiden, 1637), and Pierre de Fermat reached the same idea at about the same time.

  • Before them, geometry and algebra barely spoke. The grid let a curve be an equation, hence the name analytic geometry.
  • Street grids: 3 blocks east and 4 north is 7 blocks to walk, but 32+42=5\sqrt{3^2 + 4^2} = 5 blocks in a straight line.
  • Screens and games: every pixel has coordinates. Many screens put the origin top-left and count yy downwards, and moving, rotating or scaling a sprite is a change of coordinates.
  • Engineering drawings: design software stores every corner and hole as coordinates for exact cutting.
  • GPS: latitude and longitude are coordinates. Over a few kilometres a flat grid works; across continents the Earth's curve takes over.
on a street grid the walking distance is 7 blocks but the straight-line distance is 5
A street grid with home at (0, 0) and school at (3, 4): a green walking route of 3 blocks east and 4 blocks north, and an orange dashed straight line of 5 blocks.

Conclusion

The computer in the opening never looks at a shape: it does arithmetic on number pairs, just as this page does.

  • Every point is an ordered pair (x,y)(x, y).
  • Distance is Pythagoras, the midpoint averages, the slope is rise over run, and the section formula is a weighted average.
  • Vertical lines have undefined slope, and distance needs both axes in the same unit.
  • Trust the numbers over a sketch.

Practice and Next Steps

Try these:

  1. Find the distance between (−1,−1)(-1, -1) and (2,3)(2, 3).
  2. Find the midpoint of (4,−2)(4, -2) and (−6,8)(-6, 8).
  3. Find the slope through (0,0)(0, 0) and (3,9)(3, 9).
  4. Find the point dividing (1,2)(1, 2) to (7,8)(7, 8) in the ratio 2:12 : 1.

Answers:

  1. 32+42=5\sqrt{3^2 + 4^2} = 5.
  2. (−1,3)(-1, 3).
  3. 9−03−0=3\frac{9 - 0}{3 - 0} = 3.
  4. (2⋅7+1⋅13,2⋅8+1⋅23)=(5,6)\left(\frac{2 \cdot 7 + 1 \cdot 1}{3}, \frac{2 \cdot 8 + 1 \cdot 2}{3}\right) = (5, 6).

Check the first three in the tool. If a midpoint lands outside your segment, go back to Mistake 1.

To work through more of these with a teacher, explore Bhanzu's geometry tutor, high school math tutor, or math classes online.

Want a live Bhanzu trainer to guide your child through coordinate geometry? Book a free demo class.

Read More

Research Behind This Article

  1. OpenStax, College Algebra 2e, Section 2.1: The Rectangular Coordinate Systems and Graphs. openstax.org
  2. OpenStax, College Algebra 2e, Section 4.1: Linear Functions (slope, parallel and perpendicular lines). openstax.org
  3. MacTutor History of Mathematics, University of St Andrews, René Descartes. mathshistory.st-andrews.ac.uk
  4. MacTutor History of Mathematics, University of St Andrews, Pierre de Fermat. mathshistory.st-andrews.ac.uk

Quick Quiz: Check Yourself

Three levels, questions with figures, instant feedback with the reason.

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What is coordinate geometry in simple terms?
Geometry on a grid, where each point has a number address (x,y)(x, y). Lengths, middles and slopes come from calculation.
What are the main formulas in coordinate geometry?
Distance, midpoint, slope and the section formula. They answer how far, what centre, how steep and what dividing point.
Why is it also called analytic geometry?
Because it analyses shapes with algebra rather than compass-and-straightedge construction.
How is the distance formula related to the Pythagorean theorem?
The horizontal and vertical gaps are the legs of a right triangle, and the distance is its hypotenuse.
Does it matter which point is (x₁, y₁)?
Not for distance, midpoint and slope, if you stay consistent. It does for the section formula, where m:nm : n is measured from the first point.
What do the four quadrants tell you?
The sign pattern of a point's coordinates: I is (+,+)(+, +), II is (−,+)(-, +), III is (−,−)(-, -) and IV is (+,−)(+, -). The quadrant is a quick check on your signs.
What is the slope of a vertical line?
Undefined. The run is 0, and division by zero has no answer.
✍️ Written By
Shikha Sharma
Shikha Sharma
Subject Matter Expert
Shikha Sharma is a Mathematics Subject Matter Expert at Bhanzu with over 7 years of experience in teaching and tutoring students across India. She specialises in foundational mathematics, with a strong understanding of how children in primary and middle school develop mathematical concepts. Her approach emphasises conceptual clarity and simplifying complex mathematical ideas into clear, manageable steps that make learning accessible and engaging for young learners. She brings expertise in mental mathematics, arithmetic, algebra, logical reasoning and problem-solving, with an emphasis on building strong mathematical foundations.
🔬 Reviewed By
Madhukar V
Math Columnist & Analyst
Related Articles
Book a FREE Demo ClassBook Now →