3.6.123D Geometry

Skew lines — shortest distance

1,986 words9 min readdifficulty · medium

WHAT are we computing?

Figure — Skew lines — shortest distance

HOW: Derivation from first principles

We want the shortest segment joining a point PP on L1L_1 to a point QQ on L2L_2.

Step 1 — Geometric insight (WHY perpendicular?). Let PQ\vec{PQ} be the joining vector. If PQ\vec{PQ} were not perpendicular to L1L_1, we could slide PP a tiny bit along L1L_1 and shorten PQ\vec{PQ} (drop a perpendicular — the hypotenuse is always longer than a leg). So at the minimum, PQb1\vec{PQ}\perp \vec b_1. By the same argument PQb2\vec{PQ}\perp \vec b_2. 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\vec b_1 and b2\vec b_2 must point along n=b1×b2.\vec n = \vec b_1 \times \vec b_2. 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 b1b2\vec b_1\nparallel\vec b_2" is used.)

Step 3 — Project the gap onto n\vec n. Take ANY point on each line: a1\vec a_1 and a2\vec a_2. The vector between them is a2a1\vec a_2 - \vec a_1. The shortest distance is the length of the component of this gap along the common perpendicular direction n^=n/n\hat n = \vec n/|\vec n|: d=(a2a1)n^=(a2a1)(b1×b2)b1×b2.d = \left|\,(\vec a_2 - \vec a_1)\cdot \hat n\,\right| = \frac{\left|(\vec a_2 - \vec a_1)\cdot(\vec b_1\times\vec b_2)\right|}{|\vec b_1\times\vec b_2|}. Why this step? No matter which points a1,a2\vec a_1,\vec a_2 we pick, the along-n^\hat n component is identical, because moving along a line adds only b\vec b-vectors, which are n^\perp \hat n and contribute nothing.


Worked examples


Cartesian form

For xx1a1=yy1b1=zz1c1\dfrac{x-x_1}{a_1}=\dfrac{y-y_1}{b_1}=\dfrac{z-z_1}{c_1} and xx2a2=yy2b2=zz2c2\dfrac{x-x_2}{a_2}=\dfrac{y-y_2}{b_2}=\dfrac{z-z_2}{c_2}: d=x2x1y2y1z2z1a1b1c1a2b2c2(b1c2b2c1)2+(c1a2c2a1)2+(a1b2a2b1)2.d = \frac{\left|\begin{matrix} x_2-x_1 & y_2-y_1 & z_2-z_1\\ a_1 & b_1 & c_1\\ a_2 & b_2 & c_2\end{matrix}\right|}{\sqrt{(b_1c_2-b_2c_1)^2+(c_1a_2-c_2a_1)^2+(a_1b_2-a_2b_1)^2}}. 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.


Flashcards

When are two lines skew?
Neither parallel nor intersecting (different directions AND no common point).
Shortest-distance formula for skew lines?
d=(a2a1)(b1×b2)b1×b2d=\dfrac{|(\vec a_2-\vec a_1)\cdot(\vec b_1\times\vec b_2)|}{|\vec b_1\times\vec b_2|}.
Why is the shortest segment perpendicular to both lines?
Otherwise you could slide a point along a line and shorten it; min distance ⇒ no first-order change ⇒ perpendicular.
Why does the cross product appear?
b1×b2\vec b_1\times\vec b_2 is, by definition, perpendicular to both direction vectors — the common-perpendicular direction.
What does numerator =0=0 (lines not parallel) imply?
Lines are coplanar and therefore intersect.
Why can we pick any point on each line for a1,a2\vec a_1,\vec a_2?
Adding a multiple of b\vec b to the gap is n^\perp \hat n, so it doesn't change the projection onto n^\hat n.
Formula for shortest distance between PARALLEL lines?
d=b×(a2a1)bd=\dfrac{|\vec b\times(\vec a_2-\vec a_1)|}{|\vec b|}.
The numerator scalar triple product geometrically equals?
The signed volume of the parallelepiped formed by a2a1,b1,b2\vec a_2-\vec a_1,\vec b_1,\vec b_2.

Connections

  • Vector Cross Product — supplies the perpendicular direction.
  • Scalar Triple Product — numerator; zero ⇔ coplanar.
  • Distance from a Point to a Line (3D) — the parallel-line case.
  • Equation of a Line in 3D — vector & Cartesian forms.
  • Coplanarity of Two Lines — condition [a2a1,b1,b2]=0[\vec a_2-\vec a_1,\vec b_1,\vec b_2]=0.
  • Plane containing a line — the common perpendicular lies in related planes.

Concept Map

can be

or

or

not parallel

do not meet

shortest link

perpendicular to both

direction fixed by

ensures nonzero

project gap onto n

gives formula

if d=0

Two lines in 3D

Skew lines

Parallel

Intersecting

b1 not parallel b2

Different planes

Shortest distance segment

PQ perp b1 and b2

n = b1 x b2

(a2-a1) . n / |n|

Scalar triple product / cross norm

Hinglish (regional understanding)

Intuition Hinglish mein samjho

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\vec a_1 aur a2\vec a_2. Inke beech ka gap a2a1\vec a_2-\vec a_1 banao. Ab common-perpendicular ki direction chahiye — wo milti hai b1×b2\vec b_1\times\vec b_2 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=(a2a1)(b1×b2)b1×b2d=\dfrac{|(\vec a_2-\vec a_1)\cdot(\vec b_1\times\vec b_2)|}{|\vec b_1\times\vec b_2|}.

Ek important baat: chahe tum koi bhi point lo line par, answer same aayega, kyunki line ke along chalna means b\vec b add karna, aur b\vec 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×(a2a1)bd=\dfrac{|\vec b\times(\vec a_2-\vec a_1)|}{|\vec b|}.

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!

Go deeper — visual, from zero

Test yourself — 3D Geometry

Connections