# Shortest Distance between Two Skew Lines

Select four points , , , in three dimensions to determine two lines (green) and (blue). For almost all choices of coordinates, the lines are skew: neither parallel nor intersecting. The goal is to find the shortest distance between the two lines. As a by-product, the shortest segment between the lines is shown in red.
Write the points as vectors , , , .
The cross-product of the directions of the lines is , which gives a vector perpendicular to both lines. The unit vector in this direction is then . The equations and determine parallel planes through the two lines at distances and from the origin. Therefore, .
Here is one way to find the shortest line segment connecting the two lines. Project the points and to the plane containing the line ; call the projected points and . Let be the intersection of and .
To find the intersection, express the lines in parametric form: and . Set the right-hand sides equal and solve for . Substitute that value of in either equation to find .
Similarly for : Project the points and to the plane containing ; call the projected points ' and . Let be the intersection of and .

### PERMANENT CITATION

 Share: Embed Interactive Demonstration New! Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details » Download Demonstration as CDF » Download Author Code »(preview ») Files require Wolfram CDF Player or Mathematica.

• Combining Two 3D RotationsGeorge Beck and Jeff Bryant
• Euler Angles for Space ShuttleS. M. Blinder
• Roll a Sphere without Changing Orientation to a New Location in Two Straight RollsAaron Becker
• Skewed ConeGeorge Beck
• Three Points Determine a PlaneEd Pegg Jr
• Constructing Vector Geometry SolutionsMichael Rogers (Oxford College of Emory University)
• Slicing a Sphere along Two Parallel PlanesErik Mahieu
• Fate of the Euler Line and the Nine-Point Circle on the SpherePaolo Maraner
• Re-Orient a Sphere with Two Straight RollsAaron Becker
• Roll Any Point on the Sphere to Any Desired Latitude-Longitude Coordinates with One Straight-Line RollAaron Becker