Home
Login

Color

Indigo
Red
Green
Teal
Blue
Purple
Rose

Mode

Light
বাং

Coordinate geometry: put geometry on a grid and let algebra do the work

Coordinate geometry describes points by numbers (x, y) so that geometry questions become algebra. The distance between (x₁, y₁) and (x₂, y₂) is √((x₂ − x₁)² + (y₂ − y₁)²), the midpoint is the average of the coordinates, the slope is rise over run, and the section formula finds the point that divides a segment in a given ratio.

Drag the points

Point APoint BSegment AB
Speed

Controls

What to explore

Readings

Coordinates of A
(-4, -2)
Coordinates of B
(4, 4)
Δx (change in x)
8
Δy (change in y)
6
Distance squared
100
Distance AB
10.000
Midpoint M
(0, 1)
Slope m
0.75

How to use this simulation

  1. Start in “Distance, midpoint, slope”. Two points, A and B, sit on the grid (they start at (-4, -2) and (4, 4)). Drag either one: they snap to whole-number positions. The dashed legs and the right-angle mark show the right triangle that hides behind the distance formula.
  2. Read the numbers. Δx and Δy are the legs, “distance squared” is Δx² + Δy², and the distance is its square root. At the start AB = 10.000. The green point M is the midpoint, here (0, 1).
  3. Make A and B level (same y) and the slope reads 0. Make them stacked (same x) and the slope says “undefined”, because a vertical line has no slope. Everything in between gives rise ÷ run.
  4. Switch to “Dividing in a ratio”. Two sliders set m and n (they start at 2 and 3). The segment is cut into 5 equal steps and P sits 2 steps from A, at (-0.80, 0.40). Compare AP ÷ PB with m ÷ n in the readings; they match.
  5. Tick “External division” to push P outside the segment. Then set m = n and see why the external point disappears: you would be dividing by zero.
  6. Finish in “Locus (equidistant)”. A green line is the set of all points the same distance from A and B. Drag the orange point P across it: PA and PB are equal only when P sits exactly on the line, and the verdict tells you which side is closer.

A robot on a grid

Imagine a robot on a floor tiled with squares. You can tell it “go four tiles right and three up” and it knows exactly where to stop. Now ask a harder question: how far is its end point from the start in a straight line, not along the tiles? Or: where is the spot exactly halfway? Or: where is the spot one third of the way?

Coordinate geometry answers all of these without a ruler. The big idea, due to René Descartes in the 1600s, is to label every point with two numbers. Once a point is a pair of numbers, a line is an equation, a circle is an equation, and a geometry puzzle turns into arithmetic that a calculator can finish.

Coordinates from zero: axes, origin and quadrants

Draw a horizontal number line, the x-axis, and a vertical one, the y-axis. They cross at the origin, the point (0, 0). Every point on the plane gets an ordered pair (x, y): x tells you how far to move along the x-axis (right is positive, left is negative) and y tells you how far to move up or down.

Order matters. The point (3, 2) is three steps right and two steps up. The point (2, 3) is a different place. The two axes cut the plane into four quadrants, numbered anticlockwise starting from the top right.

QuadrantSign of xSign of yExample
First (top right)positivepositive(3, 2)
Second (top left)negativepositive(−3, 2)
Third (bottom left)negativenegative(−3, −2)
Fourth (bottom right)positivenegative(3, −2)
On the x-axisanyzero(4, 0)
On the y-axiszeroany(0, −5)

The distance formula: Pythagoras in disguise

To find the straight-line distance between A(x₁, y₁) and B(x₂, y₂), do not measure anything. Instead walk from A to B in two moves: first sideways by Δx = x₂ − x₁, then up or down by Δy = y₂ − y₁. Those two moves are the legs of a right triangle, and the straight line AB is its hypotenuse.

The simulation draws that triangle with dashed legs and a right-angle mark. Pythagoras says the hypotenuse squared equals the sum of the legs squared, so take the square root and you have the distance. Squaring also removes any minus sign, which is why it does not matter which point you call A.

AB = √((x₂ − x₁)² + (y₂ − y₁)²)distance formula

AB² = Δx² + Δy²the Pythagoras form

distance from the origin = √(x² + y²)special case, A = (0, 0)

ΔxΔyΔx² + Δy²Distance
34255
51216913
81528917
1121.41
23133.61

The midpoint: just average the coordinates

The midpoint M of AB is the point exactly halfway. Halfway in x is the average of the two x-values, and halfway in y is the average of the two y-values. There is nothing more to it.

In the simulation the green point M moves as you drag A or B. At the start it sits at (0, 1): add the x-values, halve; add the y-values, halve.

M = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)midpoint formula

x₂ = 2xₘ − x₁ and y₂ = 2yₘ − y₁find a missing endpoint from the midpoint

Slope: how steep is the line?

The slope m of the line through A and B is the rise divided by the run: how many units it climbs for every unit it moves right. Going up to the right gives a positive slope, going down gives a negative slope, a flat line has slope 0, and a vertical line has no slope at all because the run is 0 and you cannot divide by 0.

Slopes also tell you how two lines relate. Parallel lines have the same slope. Perpendicular lines have slopes whose product is −1, for example 2 and −1/2.

m = (y₂ − y₁) ÷ (x₂ − x₁)slope

parallel: m₁ = m₂same steepness

perpendicular: m₁ × m₂ = −1one steep up, the other flat down

The section formula: cutting a segment in a ratio

Sometimes the halfway point is not what you want. A surveyor needs a flag post one third of the way along a boundary. A game designer needs an enemy to appear two fifths of the way from the gate to the tower. That is dividing the segment AB in the ratio m : n.

Imagine AB cut into m + n equal steps. The point P is m steps from A and n steps from B. Because the steps are equal, P is a weighted average of A and B: B counts m times and A counts n times, then divide by m + n. The simulation draws the tick marks so you can count the steps.

P = ((m·x₂ + n·x₁) ÷ (m + n), (m·y₂ + n·y₁) ÷ (m + n))internal division in the ratio m : n

P = ((m·x₂ − n·x₁) ÷ (m − n), (m·y₂ − n·y₁) ÷ (m − n))external division (m ≠ n)

Locus: all the points equidistant from two points

A locus is the path of every point that obeys one rule. Take the rule “the same distance from A and from B”. Try some points: the midpoint M qualifies. So does a point straight above M, and one straight below. Join them all and you get a straight line through M at right angles to AB: the perpendicular bisector.

In the simulation, drag the orange point P. The two numbers PA and PB are the distances. When they are equal P is exactly on the green line, and the verdict turns green. On one side P is closer to A, on the other it is closer to B. A small green point Q glides along the line to show that QA and QB stay equal wherever it goes.

To get the equation, write PA² = PB² and expand. The squares x² and y² cancel and you are left with a straight line: Δx · x + Δy · y = (|B|² − |A|²) ÷ 2, where |B|² means x₂² + y₂². The readings print it for your points.

PA = PB ⇔ PA² = PB²square both sides to avoid roots

(x₂ − x₁)x + (y₂ − y₁)y = (x₂² + y₂² − x₁² − y₁²) ÷ 2perpendicular bisector of AB

Try it in the simulation

Five small experiments turn the formulas into things you can feel. Do them with the handles and sliders, not just by reading.

  • Drag B until Δx = 3 and Δy = 4. The distance is exactly 5. Now try Δx = 5, Δy = 12 for 13.
  • Put A and B on the same horizontal line. The distance is just |Δx| and the slope is 0. Do the same on a vertical line and the slope becomes undefined.
  • In “Dividing in a ratio”, set m = n. P lands on the midpoint. Increase m and watch P slide towards B.
  • Tick “External division”, set m = 3 and n = 2. P jumps beyond B. AP ÷ PB is still m ÷ n, but P is outside the segment.
  • In “Locus”, drag P along a diagonal line and watch PA and PB. They are equal at exactly one point on each line that crosses the bisector.

Solved problems

Each answer below is computed from the same functions the simulation uses.

Problem 1: distance between (-2, 3) and (4, 11)

Δx = 4 − (-2) = 6 and Δy = 11 − 3 = 8. So AB² = 6² + 8² = 36 + 64 = 100, and AB = √100 = 10.

Problem 2: a distance that is not whole, (1, 1) to (4, 3)

Δx = 3, Δy = 2, so AB² = 13 and AB = √13 ≈ 3.606. Leave the answer as √13 when the question asks for an exact value.

Problem 3: midpoint of (-3, 4) and (5, -2), and a missing endpoint

Add the coordinates: x-sum 2, y-sum 2. Halve them: the midpoint is (1, 1).

Reverse it: if the midpoint is (1, 1) and one end is (6, 9), the other end has x = 2 × 1 − 6 and y = 2 × 1 − 9, which is (-4, -7).

Problem 4: slope, parallel and perpendicular

Line through (1, 2) and (5, 10): slope = 8 ÷ 4 = 2. Line through (-2, 1) and (2, 9): slope = 8 ÷ 4 = 2. The slopes are equal, so the two lines are parallel.

Now (0, 0) to (6, -3) has slope -3 ÷ 6 = -0.50, and (0, 0) to (2, 4) has slope 4 ÷ 2 = 2. Their product is -1, so they are perpendicular.

Problem 5: internal division of (2, 3) and (12, 8) in the ratio 2 : 3

With m = 2, n = 3, m + n = 5. x = (2 × 12 + 3 × 2) ÷ 5 = 30 ÷ 5, and y = 25 ÷ 5. So P = (6, 5). Check: AP = 4.47, PB = 6.71, and AP ÷ PB = 0.67 = 0.67, as required.

Problem 6: external division of (1, 2) and (4, 6) in the ratio 3 : 2

Now the denominator is m − n = 1. x = (3 × 4 − 2 × 1) ÷ 1 = 10 ÷ 1, and y = 14 ÷ 1. So P = (10, 14). It lies beyond B, with PA ÷ PB = 1.50.

Problem 7: in what ratio does the x-axis cut the line joining (2, -3) and (5, 6)?

On the x-axis y = 0. Using the section formula for y: (m × 6 + n × (-3)) ÷ (m + n) = 0, so m × 6 = n × 3 and m : n = 3 : 6 = 1 : 2. The cutting point is (3, 0).

Problem 8: the locus of points equidistant from (1, 2) and (5, 6)

Let P(x, y) be such a point. PA² = PB² gives (x − 1)² + (y − 2)² = (x − 5)² + (y − 6)². Expand: the x² and y² cancel, leaving 4x + 4y = 28, which simplifies to x + y = 7. It passes through the midpoint (3, 4), and (3, 4) lies on it.

Common mistakes

These slips cost marks every year. Check for them before you hand in a paper.

  • Forgetting to square a negative difference. (−4)² is 16, not −16, and not 4.
  • Subtracting in different orders for x and y in the distance formula. Squaring hides the sign, but the pairs must still be consistent.
  • Using the wrong weights in the section formula. B pairs with m and A with n, not the other way round.
  • Dividing by m − n in an external division when m = n. There is no such point.
  • Writing the slope as run ÷ rise, or saying a vertical line has slope 0. It is undefined; a horizontal line has slope 0.

Where coordinates show up in real life

Every map app is coordinate geometry. Your phone converts your position into a coordinate pair, measures distances between pairs and finds midpoints for “meet in the middle” suggestions. Video games store every character as coordinates, and collision checks are the distance formula run thousands of times a second.

Engineers lay out bridges and roads on coordinate grids, and architects place walls and doors the same way. The section formula puts a flag at a third of the way along a boundary, and the locus idea decides where a new school should stand if it must be as close to one village as to another.

Computer graphics, robotics and even weather forecasting rest on the same idea: describe the world with numbers, then calculate.

Exam corner

Class 9 to 11 questions on coordinates are mostly one of five types. Learn to recognise the type before you start writing.

  • Distance: find AB, or show that a triangle is isosceles, equilateral or right-angled by comparing distances.
  • Midpoint: find the midpoint, or recover a missing endpoint or parameter.
  • Slope: test for parallel, perpendicular or collinear points.
  • Section formula: divide in a ratio, find the ratio, or find where an axis cuts a line.
  • Locus: find the equation of the points equidistant from two points.

Revision summary

If you remember nothing else from this page, remember these lines.

AB = √((x₂ − x₁)² + (y₂ − y₁)²)

M = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)

m = (y₂ − y₁) ÷ (x₂ − x₁)

P = ((m·x₂ + n·x₁) ÷ (m + n), (m·y₂ + n·y₁) ÷ (m + n))internal division

PA = PBthe perpendicular bisector

  • Distance is Pythagoras on the two legs Δx and Δy.
  • Midpoint is the average; section is a weighted average.
  • Parallel: equal slopes. Perpendicular: product −1.

Frequently asked questions

What is the distance formula?

The distance between (x₁, y₁) and (x₂, y₂) is √((x₂ − x₁)² + (y₂ − y₁)²). It is Pythagoras’ theorem applied to the horizontal and vertical differences.

What is the midpoint formula?

The midpoint of a segment is the average of the end coordinates: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2).

What is the section formula?

The point dividing the segment from (x₁, y₁) to (x₂, y₂) internally in the ratio m : n is ((m x₂ + n x₁) ÷ (m + n), (m y₂ + n y₁) ÷ (m + n)). For external division, replace the plus signs by minus signs and divide by m − n.

How do I find the slope of a line through two points?

Divide the change in y by the change in x: (y₂ − y₁) ÷ (x₂ − x₁). A vertical line has no slope because the denominator is zero.

How do I show two lines are parallel or perpendicular?

Parallel lines have equal slopes. Perpendicular lines have slopes whose product is −1, unless one line is vertical and the other horizontal.

What is the locus of points equidistant from two points?

It is the perpendicular bisector of the segment joining them: a straight line through the midpoint at right angles to the segment. Set PA² = PB² to get its equation.

What is the difference between internal and external division?

Internal division puts P between A and B. External division puts P on the line AB but outside the segment. The ratio m : n is the same idea, with a minus sign in the formula for external division, and it needs m ≠ n.

Do the points in the simulation snap to whole numbers?

Yes. Keeping coordinates whole means every equality, such as PA = PB, is checked exactly with integers, so rounding can never fake a match.

Keep studying this topic

The animation made the idea click; now turn it into marks. Syllabus, suggestions, textbooks and admission-test guides are below.

More math animations

Grade 8–10

Pythagorean Theorem

The Pythagorean theorem explained: formula a² + b² = c², two proofs you can watch, the converse, Pythagorean triples and 10 worked examples. Drag the triangle yourself.

Grade 10–11

Trigonometric Ratios and the Unit Circle

Drag a point round the unit circle and watch sin, cos and tan change. Standard angle table, ASTC signs, identities, radians and graphs, with solved examples.

Grade 9–11

Quadratic functions and their graphs

Drag the vertex and change a, b, c to see how a quadratic function graph moves. Learn factoring, completing the square, the quadratic formula and discriminant.

Grade 9–10

Circle theorems

All the circle theorems with drag-and-check diagrams: angle at the centre, same segment, semicircle, cyclic quadrilateral, chords, tangents and alternate segment.

Grade 9–10

Heights and distances: elevation and depression angles

What angle of elevation and angle of depression mean, how the height-and-distance formula works, and how two observations solve a tower's height without ever measuring it — with an interactive simulation and solved problems.

Grade 9–11

Probability: experimental vs theoretical probability

What probability means, how the sample-space formula P(E) = n(E)/n(S) works, and why experimental frequency edges closer to theoretical probability the more you flip, roll or draw — with a coin, dice and coloured-ball simulator.

Grade 10–11

Arithmetic and Geometric Sequences

Learn the arithmetic and geometric sequence formulas for the nth term and sum, Gauss's pairing trick, and the sum-to-infinity formula a/(1−r), with a drag-and-slide bar-chart simulation and worked examples.

Grade 9–10

Mean, Median and Mode

Learn the mean, median and mode formulas, why the median resists an outlier while the mean does not, and the grouped-data median/mode formulas, by dragging points on a number line, with worked examples.

Grade 7–11

Sets and Venn Diagrams

Shade union, intersection, difference and complement on a live Venn diagram, drop numbers into regions, check n(A ∪ B) and test De Morgan’s laws, with solved problems.

Grade 8–10

Linear equations: graphs, slope and simultaneous pairs

See slope, intercepts and angle on a straight line, then graph two linear equations to find where they meet. Learn the ratio test for one, none or infinite solutions.

Grade 10–12

Graphs of sin, cos and tan

Plot y = A sin(Bx + C) + D with sliders: see amplitude, period, phase shift, range and the asymptotes of tan live. Trigonometric graphs with solved examples.

Grade 9–10

Completing the Square and the Quadratic Formula

Watch algebra tiles complete the square, then solve quadratic equations, find the vertex and see why the formula works. Free interactive simulation with solved examples.

Grade 7–10

Area of a Circle: Proof, Formula and Solved Problems

Cut a circle into slices, slide them into a rectangle and watch the area become πr². Free interactive simulation with circumference, pi, sectors, arcs and solved problems.

Grade 8–10

Volume and Surface Area of Solids: Cube, Cuboid, Cylinder, Cone, Sphere

Rotate six solids in 3D, unfold their nets and pour a cone into a cylinder to see why it takes exactly three. Free simulation with volume, CSA and TSA formulas and solved problems.

Grade 8–10

Similar Triangles: Scale Factor, AA, SSS, SAS and Shadow Heights

Scale a triangle with a slider and watch angles stay equal, side ratios stay k and area grow by k². Free interactive similar triangles simulation with AA, SSS, SAS tests and shadow problems.

Grade 11–12

Conic Sections: Circle, Ellipse, Parabola and Hyperbola

Tilt a plane through a double cone and watch a circle, ellipse, parabola or hyperbola appear, with its standard equation, foci and eccentricity. Free conic sections simulation with solved problems.

Grade 9–11

Function Transformations: Shifts, Stretches and Reflections

Pick x², |x|, √x, sin x or 2^x and drag sliders for a, b, h and k. Watch shifts, stretches, squeezes and reflections move the graph, with the parent faded behind. Free simulation with solved problems.

Grade 11–12

Derivative as the Slope of a Tangent: Secant to Tangent

Drag a point P on x², x³, sin x, eˣ or 1/x and shrink the gap h to zero. Watch the secant become the tangent and its slope become the derivative, with the derivative graph below. Free simulation.

Grade 11–12

Riemann Sums and Integration: Area Under a Curve

Cut the area under x², x³, sin x, eˣ or √x into up to 100 strips and compare left, right, midpoint and trapezoid sums with the exact integral. Watch the error melt away. Free simulation.

Grade 11–12

Limits and the ε–δ Definition: A Visual Guide

See the epsilon-delta definition of a limit. Pick a function, shrink ε and watch the δ band follow it, with left and right limits, a hole, sin x / x and a jump where no δ works. Free simulation.

Grade 11–12

3D Vectors: Sum, Dot Product and Cross Product

Drag to rotate two 3D vectors. See the sum as a parallelogram, the dot product as a shadow and an angle, and the cross product as a perpendicular arrow whose length is the area. Free simulation.

Grade 11–12

Matrix Transformations: Rotation, Reflection, Shear and the Determinant

Change a 2×2 matrix and watch the grid, a unit square and an F-shape move. See where i-hat and j-hat land, the determinant as signed area, and the inverse. Free simulation.

Grade 11–12

Complex Numbers: Sum, Product, Powers and Roots on the Argand Plane

Drag two complex numbers on the Argand plane. See the sum as a parallelogram, the product as a rotation and stretch, conjugates, powers as a spiral and roots of unity. Free simulation.

Grade 9–12

Binary Number System: Place Value, Conversion and Addition

Flip bits and see decimal, binary, octal and hex change together. Watch conversion by repeated division by 2, regrouping into octal and hex, and binary addition with carries. Free, with worked examples.

Animations in other subjects

Physics

Refraction of light

Physics

Ohm's law

Physics

Projectile motion

Physics

Simple pendulum

Physics

Electric field

Physics

Wave interference

Physics

Free Fall

Physics

Lens ray diagrams

Physics

Newton's Laws of Motion

Physics

Spherical mirror ray diagrams

Physics

Electromagnetic Induction

Physics

Conservation of Momentum and Collisions

Physics

Work, Energy and Power

Physics

Inclined Plane

Physics

Uniform circular motion

Physics

Transverse and Longitudinal Waves

Physics

Levers and moments

Physics

Centre of mass

Physics

Spring-mass SHM

Physics

Vector addition: triangle and parallelogram laws

Physics

Relative velocity: trains and river crossing

Physics

Kepler's laws and elliptical orbits

Physics

Newton’s law of gravitation, g and satellites

Physics

Standing waves in strings and pipes

Physics

Resonance tube and the speed of sound

Physics

Beats: when two close notes pulse

Physics

Doppler effect: moving sources, listeners and sonic booms

Physics

Prism, dispersion of light and the rainbow

Physics

Kirchhoff’s laws: junction rule and loop rule

Physics

Wheatstone bridge and metre bridge

Physics

Single-slit diffraction

Physics

Defects of the human eye and their correction

Physics

Polarisation of light: Malus’s law and Brewster’s law

Physics

Charging and discharging a capacitor: the RC time constant

Physics

Magnetic field lines: bar magnet, current-carrying wire and solenoid

Physics

AC generator

Physics

Transformer

Physics

Heat transfer: conduction, convection and radiation

Physics

Photoelectric effect: Einstein’s equation and the stopping potential

Physics

Motor effect: force on a current-carrying wire and the DC motor

Physics

Gas molecules and kinetic theory: pressure, temperature and speed

Physics

The semiconductor diode: p–n junction, I–V curve and rectifier

Physics

Radioactive decay: half-life, the decay law and penetration

Physics

The Bohr atom: orbits, energy levels and the hydrogen spectrum

Chemistry

Structure of the atom

Chemistry

Acids, Bases and the pH Scale

Chemistry

Electron configuration

Chemistry

Gas laws: Boyle, Charles, Gay-Lussac, Avogadro and PV = nRT

Chemistry

How an Ionic Bond Forms

Chemistry

Electrolysis and Faraday’s Laws

Chemistry

Covalent Bond

Chemistry

Periodic Trends

Chemistry

Reaction rate and collision theory

Chemistry

States of matter: solid, liquid, gas and the heating curve

Chemistry

Atomic orbitals: the shapes of s, p and d, quantum numbers and nodes

Chemistry

Molecular shapes and VSEPR theory: bond pairs, lone pairs and angles

Chemistry

The mole concept: molar mass, Avogadro’s number and molar volume

Chemistry

Diffusion and effusion: Graham’s law of gases

Chemistry

Balancing chemical equations: method, examples and practice

Chemistry

Chemical equilibrium: the equilibrium constant Kc and Le Chatelier’s principle

Chemistry

Titration: finding an unknown concentration with a burette and an indicator

Chemistry

Galvanic cell: the Daniell cell, EMF and the Nernst equation

Chemistry

Redox reactions: oxidation numbers, electron transfer and half-equations

Chemistry

Hydrocarbons: alkanes, alkenes, alkynes and structural isomers in 3D

Chemistry

Functional groups: alcohols, aldehydes, ketones, acids, esters and amines

Chemistry

Polymerisation: addition and condensation polymers, polythene and nylon

Chemistry

Separation techniques: filtration, distillation, chromatography, crystallisation

Chemistry

Crystal lattice: SC, BCC and FCC unit cells, packing efficiency and density

Chemistry

Radioactivity: Alpha, Beta, Gamma Decay and Half-Life

Biology

Mitosis cell division

Biology

Diffusion and Osmosis

Biology

Photosynthesis

Biology

The human heart: structure and function

Biology

Mendelian Genetics

Biology

DNA Replication

Biology

Cellular Respiration

Biology

Enzyme Action

Biology

The Nerve Impulse and the Action Potential

Biology

The Nephron and Urine Formation

Biology

Meiosis Cell Division

Biology

Digestive System

Biology

Breathing Mechanism: Inhalation and Exhalation

Biology

Protein synthesis

Biology

Blood circulation: double circulation and cardiac output

Biology

Cell structure and organelles: plant cell vs animal cell

Biology

Reflex action and the reflex arc

Biology

The human eye: parts, image formation and accommodation

Biology

Muscle contraction and the sliding-filament model

Biology

Transport in plants: xylem, phloem and transpiration

Biology

Food chain and food web: energy flow and the 10 % rule

Biology

Population growth: exponential and logistic curves

Biology

Natural selection: peppered moths and the sooty tree

Biology

Immune response: primary and secondary antibody response

Biology

Pollination and fertilisation