The cross product d1×d2 is perpendicular to both lines. Projecting the connecting vector onto this direction gives the perpendicular distance between the two skew lines. If the lines are parallel, d1×d2=0 — use a different formula instead.
Alternative Method
For coplanar (intersecting) lines, the shortest distance is zero — and the scalar triple product (a2−a1)⋅(d1×d2) equals zero. So this product also tests coplanarity. Here it’s 1=0, confirming the lines are skew.
If the lines are parallel (d1∥d2), use d=∣(a2−a1)×d1∣/∣d1∣ instead. JEE often gives a parallel-lines variant to trick students.
Common Mistake
Students sometimes forget the absolute value in the numerator and report a negative distance. Distances are always non-negative — wrap the scalar triple product in ∣⋅∣ before dividing.
Want to master this topic?
Read the complete guide with more examples and exam tips.