In short
Three-dimensional coordinate geometry locates every point in space with an ordered triple (x, y, z). Three mutually perpendicular axes divide space into eight octants. The distance formula and section formula from 2D carry over almost unchanged — just with an extra term for the third coordinate.
Stand in the middle of an empty room. Point your right arm at the far wall — that is one direction. Point your left arm at the side wall — that is a second direction, perpendicular to the first. Now point straight up at the ceiling — that is a third direction, perpendicular to both.
You have just set up three coordinate axes. Every object in the room — the corner of a table, the tip of a hanging bulb, a fly buzzing near the ceiling — can be described by saying how far it is along each of those three directions. Two numbers located points on a flat sheet of paper. Three numbers locate points in the entire room. In the entire universe, in fact. That is what three-dimensional coordinate geometry does.
The jump from 2D to 3D looks like a small step — you are just adding one more number to the pair (x, y). But that one extra number opens up an entirely new world: planes, octants, skew lines, and surfaces that could never exist in a flat world. The good news is that the algebra you already know — the distance formula, the section formula — transfers almost intact. The pictures are harder to draw on paper, but the formulas are clean.
The three axes
In two dimensions, you had two perpendicular lines: the x-axis (horizontal) and the y-axis (vertical), meeting at the origin O. In three dimensions, you add a third axis — the z-axis — perpendicular to both.
The standard convention, used across Indian textbooks and the rest of the world, is the right-hand rule: if you curl the fingers of your right hand from the positive x-axis toward the positive y-axis, your thumb points along the positive z-axis.
A point P in space is located by three numbers: its x-coordinate, y-coordinate, and z-coordinate. You write P = (x, y, z) — an ordered triple. The origin is (0, 0, 0).
To reach P = (3, 4, 5) from the origin, walk 3 units along the positive x-axis, then 4 units parallel to the positive y-axis, then 5 units parallel to the positive z-axis (straight up). That is exactly the same idea as 2D coordinates, with one more step.
The three coordinate planes
Every pair of axes defines a flat plane:
| Plane | Equation | What it contains |
|---|---|---|
| xy-plane | z = 0 | All points with zero height — the "floor" |
| yz-plane | x = 0 | All points with zero x-coordinate — the "side wall" |
| xz-plane | y = 0 | All points with zero y-coordinate — the "back wall" |
These three planes slice through the origin and divide all of space into eight regions, just as the two axes in 2D divided the plane into four quadrants.
A point lies on the xy-plane if and only if its z-coordinate is zero. Similarly, a point lies on the x-axis if and only if both its y- and z-coordinates are zero. The origin is the only point that lies on all three axes and all three planes simultaneously.
The eight octants
In two dimensions, two axes carve the plane into four quadrants. In three dimensions, three planes carve space into eight octants.
The first octant is where x > 0, y > 0, and z > 0. Think of it as the "front-upper-right" region of space. The other seven octants correspond to all possible combinations of positive and negative signs for the three coordinates.
| Octant | Sign of x | Sign of y | Sign of z |
|---|---|---|---|
| I | + | + | + |
| II | - | + | + |
| III | - | - | + |
| IV | + | - | + |
| V | + | + | - |
| VI | - | + | - |
| VII | - | - | - |
| VIII | + | - | - |
You do not need to memorise the numbering — different textbooks number the octants differently. What matters is that the signs determine the octant uniquely. Given a point like (-2, 5, -3), you can immediately say it lies in the octant where x < 0, y > 0, z < 0.
The distance formula
In 2D, the distance between two points (x_1, y_1) and (x_2, y_2) is
That is Pythagoras's theorem applied once. In 3D, you apply Pythagoras twice — and the result picks up one more term under the square root.
Derivation
Take two points P = (x_1, y_1, z_1) and Q = (x_2, y_2, z_2). You want to find PQ.
Step 1. Project both points onto the xy-plane (set their z-coordinates to zero). Call the projections P' = (x_1, y_1, 0) and Q' = (x_2, y_2, 0). By the 2D distance formula,
Step 2. Drop a perpendicular from Q to the horizontal plane at height z_1 (the plane through P). The foot of this perpendicular is the point R = (x_2, y_2, z_1) — it has Q's x- and y-coordinates but P's height. The segment QR is purely vertical, with length |z_2 - z_1|. The segment PR lies entirely in the horizontal plane at height z_1, and by the 2D formula its length is
Step 3. The triangle PRQ is right-angled at R (because QR is vertical and PR is horizontal). Apply Pythagoras:
Step 4. Take the square root:
That is the 3D distance formula. The pattern is clear: each new dimension contributes one more squared difference under the root. In one dimension, distance is |x_2 - x_1|. In two, you add (y_2 - y_1)^2. In three, you add (z_2 - z_1)^2.
Distance formula in 3D
The distance between two points P(x_1, y_1, z_1) and Q(x_2, y_2, z_2) is
Special case: distance from the origin. Setting (x_1, y_1, z_1) = (0, 0, 0), the distance of the point (x, y, z) from the origin is \sqrt{x^2 + y^2 + z^2}.
The section formula
In 2D, if a point R divides the segment from P(x_1, y_1) to Q(x_2, y_2) in the ratio m : n, then
In 3D, the formula extends in the most natural way possible — the z-coordinate follows exactly the same weighted-average pattern.
Derivation
Take P = (x_1, y_1, z_1) and Q = (x_2, y_2, z_2). The point R divides PQ internally in the ratio m : n, meaning PR : RQ = m : n.
Consider what this means coordinate by coordinate. The x-coordinate of R must divide the interval from x_1 to x_2 in the ratio m : n, because projecting the segment PQ onto the x-axis preserves the division ratio. (A ratio on a line segment is preserved under projection onto any axis — this follows from similar triangles.) So the x-coordinate of R is \dfrac{mx_2 + nx_1}{m + n}, which is the 2D section formula applied to just the x-values.
The same reasoning applies independently to the y- and z-coordinates.
Section formula in 3D (internal division)
If the point R divides the segment from P(x_1, y_1, z_1) to Q(x_2, y_2, z_2) internally in the ratio m : n, then
Midpoint. Setting m = n = 1, the midpoint of PQ is
External division. If R divides PQ externally in the ratio m : n (meaning R lies on the line PQ but outside the segment), replace n with -n in the formula:
This is exactly the same convention as in 2D. The only new thing is the third coordinate — the algebra is identical.
Computing one from start to finish
Example 1: Distance between two points
Find the distance between A = (1, 2, 3) and B = (4, 6, 3).
Step 1. Write down the differences in each coordinate.
Why: the distance formula needs the squared differences, so compute the differences first. Notice that both points have the same z-coordinate — they lie at the same height.
Step 2. Square each difference.
Why: squaring removes negative signs and sets up the Pythagorean sum.
Step 3. Add the squares.
Why: this is PQ^2 — the squared distance.
Step 4. Take the square root.
Why: the distance itself is the square root of the sum of squared differences.
Result: AB = 5.
Because z_1 = z_2 = 3, both points lie in the plane z = 3, and the distance reduces to the 2D formula. You get the classic 3-4-5 right triangle. The picture confirms the algebra.
Example 2: Section formula — finding a dividing point
The point R divides the segment from P(2, -1, 4) to Q(5, 3, -2) internally in the ratio 2 : 1. Find the coordinates of R.
Step 1. Identify m = 2, n = 1, and write the formula for each coordinate.
Why: R is closer to Q than to P (ratio 2 : 1), so Q's coordinate gets the larger weight.
Step 2. Compute the x-coordinate.
Step 3. Compute the y-coordinate.
Why: the same weighted-average formula, applied to the y-values.
Step 4. Compute the z-coordinate.
Why: the z-coordinate comes out to zero, meaning R lies exactly on the xy-plane. This makes geometric sense — P has z = 4 (above the plane) and Q has z = -2 (below it), and a point two-thirds of the way from P to Q crosses through z = 0.
Result: R = \left(4,\;\dfrac{5}{3},\;0\right).
The picture makes the ratio visible: R sits two-thirds of the way from P to Q. Its z-coordinate is zero, confirming that R lies on the xy-plane — exactly where you would expect a point two-thirds of the way from z = 4 to z = -2 to land.
Common confusions
-
"The z-axis always points up." In the standard right-hand system, yes — and this is what Indian textbooks use. But some branches of engineering and computer graphics use a left-hand system or swap which axis is "up." Always check the convention.
-
"A point on the x-axis has coordinates (x, 0)." That is 2D thinking. In 3D, a point on the x-axis has coordinates (x, 0, 0) — both the y- and z-coordinates are zero. Forgetting the third coordinate is the single most common slip in 3D problems.
-
"The distance formula has a cube root in 3D." No. It is still a square root. The Pythagorean theorem is about squares, not cubes, regardless of how many dimensions you work in. What changes is the number of squared terms under the root: two terms in 2D, three in 3D.
-
"External division gives a different formula." The formula is the same — you just replace n with -n. In practice, most errors come from sign mistakes. If you get an unexpected answer, check that you put the m weight on the second point Q and the n weight on the first point P.
-
"Octant numbering is universal." It is not. Different textbooks number the octants differently beyond the first octant. What is universal is the sign convention: the first octant is always (+, +, +), and the signs uniquely determine the octant. Focus on signs, not numbers.
Going deeper
If you are comfortable with the coordinate axes, the distance formula, and the section formula, you have the core of 3D coordinates — you can stop here. The rest is for readers who want the fuller picture.
Coordinates along a single axis
Some useful special cases to internalise:
- Points on the x-axis have the form (a, 0, 0). Their y- and z-coordinates are both zero.
- Points on the y-axis have the form (0, b, 0).
- Points on the z-axis have the form (0, 0, c).
- Points on the xy-plane have the form (a, b, 0) — the z-coordinate is zero.
- Points on the yz-plane have the form (0, b, c).
- Points on the xz-plane have the form (a, 0, c).
These follow directly from the definitions. A point lies on the x-axis if and only if its distance from the x-axis is zero, which happens precisely when y = 0 and z = 0.
The distance of a point from an axis
The distance of a point P(x, y, z) from the x-axis is not |x| — it is the distance from P to the nearest point on the x-axis, which is (x, 0, 0). By the distance formula:
Similarly, the distance from a coordinate axis involves the other two coordinates:
| Distance from | Formula |
|---|---|
| x-axis | \sqrt{y^2 + z^2} |
| y-axis | \sqrt{x^2 + z^2} |
| z-axis | \sqrt{x^2 + y^2} |
These are worth remembering. The distance from the z-axis, \sqrt{x^2 + y^2}, is the same as the 2D distance from the origin — because projecting onto the xy-plane and measuring distance from the origin is exactly what "distance from the z-axis" means.
Reflections
Reflecting a point across a coordinate plane simply negates the appropriate coordinate:
- Reflection of (a, b, c) in the xy-plane: (a, b, -c)
- Reflection of (a, b, c) in the yz-plane: (-a, b, c)
- Reflection of (a, b, c) in the xz-plane: (a, -b, c)
Reflecting across the origin negates all three: (-a, -b, -c).
These follow from the same logic as reflections in 2D. To reflect in the xy-plane, you keep the x- and y-coordinates and flip the z-coordinate — because the xy-plane is the set of points where z = 0, and the reflected point is equally far from this plane but on the opposite side.
A note on dimensions beyond three
The distance formula \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2 + (z_2-z_1)^2} has an obvious pattern: one squared difference per dimension. Mathematicians define distance in four or more dimensions by continuing this pattern — \sqrt{\sum (x_{i,2} - x_{i,1})^2} — even though you cannot draw a picture anymore. The section formula likewise generalises by applying the weighted average to each coordinate independently. The algebra does not care how many dimensions you have; it is the pictures that stop working past three.
Where this leads next
You now have the language to describe any point in space and to measure distances and divide segments. The next step is to talk about directions — not just where a point is, but which way a line points.
- Direction Cosines and Ratios — how to describe the direction of a line in 3D using the angles it makes with the three axes.
- Straight Line in 3D — Equations — writing the equation of a line in space, using the coordinate system you just set up.
- Vectors Introduction — the tool that combines position and direction into a single object, making 3D geometry far more manageable.
- Coordinate Geometry Basics — the 2D foundation this article builds on, if you want to revisit it.