We build it ourselves — never just trust the formula.
Step 1 — Drop into a box.
Place P and Q as opposite corners of an axis-aligned rectangular box (cuboid).
The three edges of this box have lengths:
a=∣x2−x1∣,b=∣y2−y1∣,c=∣z2−z1∣
Why this step? Because the differences in each coordinate are exactly the box edges parallel to the axes — that converts "distance" into a geometry of right angles we already understand.
Step 2 — Pythagoras on the floor.
Look only at the bottom face of the box. The diagonal d of this rectangle (in the xy-plane) satisfies:
d2=a2+b2
Why this step? The two edges a and b meet at 90∘ (x-axis ⟂ y-axis), so the floor diagonal is a plain 2D Pythagoras.
Step 3 — Pythagoras going up.
Now the body diagonal PQ is the hypotenuse of a new right triangle whose legs are the floor diagonal d and the vertical edge c. The vertical edge is perpendicular to the entire floor, so:
PQ2=d2+c2=(a2+b2)+c2
Why this step? The z-direction is perpendicular to the whole xy-plane, hence perpendicular to d which lies in that plane — so again Pythagoras applies cleanly.
Imagine a shoebox. A tiny ant sits in one bottom corner and a crumb is in the opposite top corner. The ant can't walk straight through the box — but we can measure that straight diagonal. First measure across the floor (one Pythagoras using the box's length and width). Then tilt up to the top corner (another Pythagoras using that floor-diagonal and the box's height). Stack those two and you get one neat rule: square the differences in length, width, and height, add them, take the square root. That number is the real straight-line gap.
Dekho, 3D distance formula bilkul Pythagoras ka hi bada bhai hai. 2D mein hum do points ke beech distance nikalte the right triangle ki hypotenuse banaake. 3D mein bas ek extra direction aa gaya — z-axis. Toh hum Pythagoras do baar lagate hain: pehle box ke floor ka diagonal nikalo (d2=a2+b2), phir us diagonal ke saath height c ko jodo (PQ2=d2+c2). Final answer: PQ=(x2−x1)2+(y2−y1)2+(z2−z1)2.
Sabse important baat — har coordinate ka difference alag se lo: x ke saath x, y ke saath y, z ke saath z. Phir square karo, add karo, aur end mein square root lena mat bhoolna. Squaring ki wajah se subtract karne ka order matter nahi karta — (x2−x1)2 aur (x1−x2)2 same hote hain.
Yeh formula kaafi jagah kaam aata hai: collinearity check karne mein (jab badi distance = baaki do ka sum ho), unknown coordinate dhoondhne mein, aur sphere ka equation banane mein (sphere matlab centre se fixed distance par saare points). Vector language mein, PQ bas vector PQ ka magnitude ∣PQ∣ hai — same cheez, doosra naam.
Practice tip: ek shoebox ki picture mind mein rakho. Ant ek corner par, crumb opposite corner par — straight line gap hi distance hai. Yeh dual coding tumhe formula yaad rakhne mein bahut help karega.