Distance between two points in space
NCERT Class 11 Mathematics Chapter 11 Section 11.4
Quick answer
The distance PQ between two points P(x, y, z) and Q(x, y, z) in space is given by PQ = (x − x) + (y − y) + (z − z), so PQ is the square root of this sum. It comes from Pythagoras’ theorem used twice in the box that has PQ as a diagonal. From the origin, OP = √(x + y + z).
With your textbook
NCERT Mathematics (Class 11), Chapter 11 “Introduction to Three Dimensional Geometry”, Section 11.4 “Distance between Two Points”, pages 211–213.
Open the official NCERT chapter (PDF, 1.3 MB, ncert.nic.in) (opens in a new tab)
Checked against the 2026-27 reprint on .
The distance formula in space
We have studied about the distance between two points in two-dimensional coordinate system. Let us now extend this study to three-dimensional system.
NCERT Mathematics (Class 11), Section 11.4, page 211
Distance between two points
- The distance PQ between P(x1, y1, z1) and Q(x2, y2, z2) is given by PQ2 = (x2 − x1)2 + (y2 − y1)2 + (z2 − z1)2, and PQ is the square root of this sum.
- The distance of P(x, y, z) from the origin O is OP = √(x2 + y2 + z2).
In plain words: find how far apart the two points are along each axis, square the three gaps, add, and take the square root. It is the distance formula of the plane with one more square under the root. When z1 = z2, the third term is 0 and the plane formula comes back.
Distance formula in three dimensions
PQ = (x − x) + (y − y) + (z − z)
OP = x + y + z
Why it works: Pythagoras twice
Through the points P and Q draw planes parallel to the coordinate planes so as to form a rectangular parallelopiped with one diagonal PQ (Fig 11.4).
NCERT Mathematics (Class 11), Section 11.4, page 211
Go from P to Q along three edges of this box: first parallel to the y-axis to A, then parallel to the x-axis to N, then parallel to the z-axis up to Q. The three edges are as long as the three gaps between the coordinates: PA = |y2 − y1|, AN = |x2 − x1| and NQ = |z2 − z1|. NCERT writes them without the bars, which is harmless because they are squared next.
- PA is perpendicular to the face that contains A, N and Q, so ∠PAQ = 90° and PQ2 = PA2 + AQ2.
- AN is horizontal and NQ vertical, so ∠ANQ = 90° and AQ2 = AN2 + NQ2.
Put the second into the first:
PQ2 = PA2 + AN2 + NQ2
= (y2 − y1)2 + (x2 − x1)2 + (z2 − z1)2.
With P at the origin, OQ = √(x2 + y2 + z2): for (2, −6, 9) it is √(4 + 36 + 81) = 11.
Distance from an axis (JEE). The foot of the perpendicular from P(x, y, z) to the x-axis is (x, 0, 0), so the distance of P from the x-axis is √(y2 + z2). Likewise it is √(z2 + x2) from the y-axis and √(x2 + y2) from the z-axis.
What the formula is used for
Collinear points.
We know that points are said to be collinear if they lie on a line.
NCERT Mathematics (Class 11), Section 11.4, page 212
Three points P, Q and R are collinear exactly when the longest of PQ, QR and PR equals the sum of the other two. If it is shorter, the three points form a triangle.
Right angles and equal sides. Work with the squares of the sides. A triangle has a right angle exactly when the square of its longest side equals the sum of the squares of the other two (Pythagoras and its converse). Two equal sides make it isosceles.
Sets of points. A condition on distances becomes an equation in x, y and z, as in a locus in the plane. The points equidistant from A and B form a plane (NCERT Example 8, below). The points at a fixed distance r from C(a, b, c) form a sphere, (x − a)2 + (y − b)2 + (z − c)2 = r2.
Parallelograms: a trap in NCERT Example 7. NCERT Example 7 (page 214) finds AB = CD and BC = AD and concludes:
Since AB = CD and BC = AD, ABCD is a parallelogram.
NCERT Mathematics (Class 11), Chapter 11, Miscellaneous Examples, page 214
In space this reasoning is not valid. Fold a rhombus along a diagonal: the four sides keep their lengths, so opposite sides stay equal, but the four corners no longer lie in one plane. A quadrilateral whose corners are not in one plane is not a parallelogram. NCERT’s answer is still right, because its points do form a parallelogram. The test that works in space is the one in NCERT’s own note on the same page:
We can also show that ABCD is a parallelogram, using the property that diagonals AC and BD bisect each other.
NCERT Mathematics (Class 11), Chapter 11, Miscellaneous Examples, page 214
The diagonals bisect each other when their mid-points are the same point. The mid-point of P(x1, y1, z1) and Q(x2, y2, z2) is ((x1 + x2)/2, (y1 + y2)/2, (z1 + z2)/2): each coordinate is halfway between those of P and Q.
Solved examples
Example 1: A distance (NCERT Example 3, page 212)
Find the distance between P(1, −3, 4) and Q(−4, 1, 2).
The differences of the coordinates are −4 − 1 = −5, 1 − (−3) = 4 and 2 − 4 = −2, so
PQ2 = 25 + 16 + 4 = 45.
Answer: PQ = √45 = 3√5 units.
Example 2: Collinear points (NCERT Example 4, page 212)
Show that P(−2, 3, 5), Q(1, 2, 3) and R(7, 0, −1) are collinear.
PQ = √(9 + 1 + 4) = √14
QR = √(36 + 4 + 16) = √56 = 2√14
PR = √(81 + 9 + 36) = √126 = 3√14
Answer: PQ + QR = √14 + 2√14 = 3√14 = PR, so P, Q and R are collinear, with Q between P and R. NCERT Exercise 11.2, Q2 asks the same question for the same three points.
Example 3: Is it a right triangle? (NCERT Example 5, pages 212–213)
Are A(3, 6, 9), B(10, 20, 30) and C(25, −41, 5) the vertices of a right-angled triangle?
AB2 = 49 + 196 + 441 = 686
BC2 = 225 + 3721 + 625 = 4571
CA2 = 484 + 2209 + 16 = 2709
BC is the longest side, so only one check is needed: a right angle would be at A, with AB2 + CA2 = BC2. But 686 + 2709 = 3395, not 4571.
Answer: no, ABC is not a right-angled triangle.
Example 4: PA + PB fixed (NCERT Example 6, page 213)
Find the set of points P with PA2 + PB2 = 2k2, where A(3, 4, 5) and B(−1, 3, −7).
(x − 3)2 + (y − 4)2 + (z − 5)2
+ (x + 1)2 + (y − 3)2 + (z + 7)2 = 2k2
The constants add up to 9 + 16 + 25 + 1 + 9 + 49 = 109. The x-terms give −6x + 2x = −4x, the y-terms −8y − 6y = −14y and the z-terms −10z + 14z = 4z.
Answer: 2x2 + 2y2 + 2z2 − 4x − 14y + 4z = 2k2 − 109.
Divide by 2 and complete the squares:
(x − 1)2 + (y − 7/2)2 + (z + 1)2
= k2 − 109/2 + 1 + 49/4 + 1
= k2 − 161/4.
For k2 > 161/4 this is the sphere with centre (1, 7/2, −1), the mid-point of AB, and radius √(k2 − 161/4). For k2 = 161/4 it is just the mid-point; for smaller k2, no point.
Example 5: Equidistant from two points (NCERT Example 8, page 214)
Find the set of points P(x, y, z) with PA = PB, where A(3, 4, −5) and B(−2, 1, 4).
Square both sides; the x2, y2 and z2 terms cancel:
−6x − 8y + 10z + 50 = 4x − 2y − 8z + 21
Answer: 10x + 6y − 18z − 29 = 0, a plane. It passes through the mid-point (1/2, 5/2, −1/2) of AB.
Example 6: A parallelogram, not a rectangle (NCERT Example 7, pages 213–214)
Show that A(1, 2, 3), B(−1, −2, −1), C(2, 3, 2) and D(4, 7, 6) are the vertices of a parallelogram ABCD that is not a rectangle.
The diagonals bisect each other:
mid-point of AC = (3/2, 5/2, 5/2)
mid-point of BD = (3/2, 5/2, 5/2)
So ABCD is a parallelogram (its sides are AB = CD = 6 and BC = DA = √43). Its diagonals are AC = √(1 + 1 + 1) = √3 and BD = √(25 + 81 + 49) = √155.
Answer: AC ≠ BD, and a parallelogram is a rectangle only when its diagonals are equal, so ABCD is not a rectangle.
Common mistakes to avoid
Common mistake
Dropping the z-term
In space, PQ2 has three squares. Using only (x2 − x1)2 + (y2 − y1)2 gives the distance between the feet of P and Q on the XY-plane, not PQ.
Common mistake
Losing a minus sign inside a bracket
From y = −3 to y = 1 the gap is 1 − (−3) = 4, so the square is 16, not 4.
Common mistake
Testing the wrong pair for a right angle
Only the longest side can be the hypotenuse. In Example 3, check AB2 + CA2 against BC2; the other two sums cannot work.
Common mistake
Proving a parallelogram from equal opposite sides
Equal opposite sides prove a parallelogram only for an uncrossed quadrilateral drawn in a plane. Four points given by coordinates may not lie in one plane, and even in a plane they can form a crossed shape: A(0, 0, 0), B(3, 1, 0), C(4, 0, 0), D(1, 1, 0) have AB = CD and BC = DA. Show that the diagonals have the same mid-point.
Quick revision summary
- PQ2 = (x2 − x1)2 + (y2 − y1)2 + (z2 − z1)2, and PQ is its square root; from the origin, OP = √(x2 + y2 + z2).
- It comes from Pythagoras’ theorem used twice in the box with diagonal PQ.
- Collinear: the longest of the three distances equals the sum of the other two. Right angle: the longest side squared equals the sum of the other two squares.
- In space, a parallelogram needs diagonals with the same mid-point; equal opposite sides are not enough.
- The distance of P(x, y, z) from the x-axis is √(y2 + z2).
Formula sheet
- PQ = (x − x) + (y − y) + (z − z)
- OP = √(x + y + z)
- distance of P(x, y, z) from the x-axis: √(y + z)
- sphere, centre (a, b, c), radius r: (x − a) + (y − b) + (z − c) = r
Questions students ask
What is the shortest distance between two points in 3D?
The shortest distance between two points in 3D is the length of the straight segment joining them, which is what the distance formula gives: PQ is the square root of the sum of the squares of x2 − x1, y2 − y1 and z2 − z1. Every other path from P to Q is longer: from O to (1, 4, 8) the segment is 9 units long, but the walk along three edges of the box is 1 + 4 + 8 = 13 units. The phrase “shortest distance” also names the distance between two skew lines, lines in space that neither meet nor are parallel; that is a Class 12 topic, listed in the JEE Main syllabus (Unit 11).
Can the distance between two points be negative?
No, the distance between two points is never negative: the distance formula takes the non-negative square root of a sum of squares, so PQ ≥ 0, and PQ = 0 only when P and Q are the same point. The gaps such as x2 − x1 can be negative, but squaring removes their signs, so PQ = QP and either point may be taken first.
How is the 3D distance formula related to vectors?
The 3D distance formula gives the magnitude of the vector from P to Q, whose components are the coordinate gaps x2 − x1, y2 − y1 and z2 − z1: the length of a vector in space is the square root of the sum of the squares of its components, as on the physics page on vectors in three dimensions. With rP and rQ the position vectors of P and Q, PQ = |rQ − rP|. Vector algebra itself is a Class 12 maths topic, Unit 12 of the JEE Main syllabus.
How do you find the point on the x-axis equidistant from two points in 3D?
To find the point on the x-axis equidistant from A and B, write it as P(x, 0, 0), since every point of the x-axis has y = 0 and z = 0, and set PA2 = PB2: the x2 terms cancel and leave a linear equation. For A(3, 2, 1) and B(1, −1, 2), (x − 3)2 + 4 + 1 = (x − 1)2 + 1 + 4 gives −6x + 9 = −2x + 1, so x = 2, and the point is (2, 0, 0), √6 from each. A point (x, y, 0) of the XY-plane equidistant from three given points is found the same way, from two such linear equations.
Is the 3D distance formula the same as the Euclidean distance?
Yes, the 3D distance formula is the Euclidean distance in three dimensions, the straight-line distance that follows Pythagoras’ theorem. It extends to any number of coordinates by adding one squared gap for each, so in four dimensions (1, 0, 2, 3) and (3, 1, 0, 7) are √(4 + 1 + 4 + 16) = 5 apart; distances in four or more dimensions, beyond the JEE Main syllabus, are used in statistics and machine learning. Other measures, such as the taxicab distance, which adds the sizes of the three gaps without squaring them, are not Euclidean.
Practice questions
Try each question first, then open the answer to check your working.
-
Q1. Find the distance between (i) (2, 3, 5) and (4, 3, 1); (ii) (−3, 7, 2) and (2, 4, −1); (iii) (−1, 3, −4) and (1, −3, 4); (iv) (2, −1, 3) and (−2, 1, 3) (NCERT Exercise 11.2, Q1).
Show answerHide answer
(i) √(4 + 0 + 16) = 2√5; (ii) √(25 + 9 + 9) = √43; (iii) √(4 + 36 + 64) = √104 = 2√26; (iv) √(16 + 4 + 0) = 2√5.
-
Q2. Verify that (0, 7, −10), (1, 6, −6) and (4, 9, −6) are the vertices of an isosceles triangle (NCERT Exercise 11.2, Q3 (i)).
Show answerHide answer
The squares of the sides are 1 + 1 + 16 = 18, 9 + 9 + 0 = 18 and 16 + 4 + 16 = 36. Two sides are 3√2, so the triangle is isosceles. Since 18 + 18 = 36, it also has a right angle, at (1, 6, −6).
-
Q3. Verify that (0, 7, 10), (−1, 6, 6) and (−4, 9, 6) are the vertices of a right-angled triangle (NCERT Exercise 11.2, Q3 (ii)).
Show answerHide answer
The squares of the sides are 1 + 1 + 16 = 18, 9 + 9 + 0 = 18 and 16 + 4 + 16 = 36. Since 18 + 18 = 36, the angle at (−1, 6, 6) is a right angle.
-
Q4. Find the equation of the set of points equidistant from (1, 2, 3) and (3, 2, −1) (NCERT Exercise 11.2, Q4).
Show answerHide answer
The y-terms are equal and cancel, leaving (x − 1)2 + (z − 3)2 = (x − 3)2 + (z + 1)2. Expanding:
−2x − 6z + 10 = −6x + 2z + 10
that is, x − 2z = 0.