We want the shortest segment joining a point P on L1 to a point Q on L2.
Step 1 — Geometric insight (WHY perpendicular?).
Let PQ be the joining vector. If PQ were not perpendicular to L1, we could slide P a tiny bit along L1 and shorten PQ (drop a perpendicular — the hypotenuse is always longer than a leg). So at the minimum, PQ⊥b1. By the same argument PQ⊥b2.
Why this step? The minimum of a distance occurs where moving along either line gives no first-order change — that's exactly perpendicularity.
Step 2 — Direction of the common perpendicular.
A vector perpendicular to both b1 and b2 must point along
n=b1×b2.Why this step? The cross product is by definition perpendicular to both inputs. (It's nonzero precisely because the lines aren't parallel — that's where "skew needs b1∦b2" is used.)
Step 3 — Project the gap onto n.
Take ANY point on each line: a1 and a2. The vector between them is a2−a1. The shortest distance is the length of the component of this gap along the common perpendicular directionn^=n/∣n∣:
d=∣(a2−a1)⋅n^∣=∣b1×b2∣∣(a2−a1)⋅(b1×b2)∣.Why this step? No matter which points a1,a2 we pick, the along-n^ component is identical, because moving along a line adds only b-vectors, which are ⊥n^ and contribute nothing.
For a1x−x1=b1y−y1=c1z−z1 and a2x−x2=b2y−y2=c2z−z2:
d=(b1c2−b2c1)2+(c1a2−c2a1)2+(a1b2−a2b1)2x2−x1a1a2y2−y1b1b2z2−z1c1c2.
Same formula, just written with components.
Recall Feynman: explain to a 12-year-old
Imagine two straight pieces of wire floating in a room that never touch and aren't pointing the same way. There's exactly one shortest stick you could place connecting them — and that stick pokes both wires at a perfect right angle. To find its length: pick any point on each wire, draw an arrow between them, then measure only the part of that arrow pointing in the "right-angle-to-both" direction. The cross product tells you that direction; the dot product measures how much of the arrow points that way.
Dekho, 3D space me do lines teen tarah se behave karti hain: ya to intersect karti hain, ya parallel hoti hain, ya phir skew — matlab na parallel na milti hain, bilkul alag-alag planes me. Skew lines ke beech ki "shortest distance" wo chhota sa segment hai jo dono lines ko ekdum perpendicular (90°) par touch karta hai. Yahi unique stick sabse chhoti hoti hai.
Formula yaad rakhne ka logic simple hai. Dono lines par koi bhi ek-ek point pakdo: a1 aur a2. Inke beech ka gap a2−a1 banao. Ab common-perpendicular ki direction chahiye — wo milti hai b1×b2 se, kyunki cross product hamesha dono vectors ke perpendicular hota hai. Phir gap ko us perpendicular direction par project kar do (dot product), aur magnitude se divide kar do. Bas: d=∣b1×b2∣∣(a2−a1)⋅(b1×b2)∣.
Ek important baat: chahe tum koi bhi point lo line par, answer same aayega, kyunki line ke along chalna means b add karna, aur b to perpendicular direction par zero contribute karta hai. Agar numerator (triple product) zero aa jaye aur lines parallel na ho, to lines actually intersect kar rahi hain — skew nahi. Aur agar lines parallel ho jayein, to cross product zero ho jata hai, tab alag formula use karo: d=∣b∣∣b×(a2−a1)∣.
Exam tip: "Cross gives the way, dot gives the stretch, divide to make it pure length" — isi mantra se pura formula recall ho jayega. Absolute value lagana mat bhoolna, distance kabhi negative nahi hoti!