TITLE: Find 3D distance between two parallel lines in simple way
QUESTION [6 upvotes]: Is there a simple way to get 3D distance between two parallel lines given end points of each line?

REPLY [10 votes]: Simplest way in my opinion:
You can easily calculate the unit direction vector $v$ in each line (subtract the two end points and then divide by the distance between them). $v$ is the same for both lines since they are parallel.
Now we say that $line1$ is represented by a point $p1$ and a unit vector $v$.
and $line2$ is represented by a point $p2$ and the same unit vector $v$.
Then in this case the distance between $line1$ and $line2$ is $||v \times (p_2-p_1)||$.
You can see why in the drawing below: