(in 3-dimensional space)
Let l1 and l2 be lines in space that do not intersect. There are two cases. If l1 and l2 are parallel, the distance between the two lines is the length of any line segment N1N2, with N1 on l1 and N2 on l2 perpendicular to both lines. If l1 and l2 are not parallel, there are unique points N1 on l1 and N2 on l2 such that the length of the line segment N1N2 is the shortest possible. The length |N1N2| is the distance between the two lines. In fact, the line N1N2 is the common perpendicular of l1 and l2.