Find 3D distance between two parallel lines in simple way Is there a simple way to get 3D distance between two parallel lines given end points of each line?

 A: Indeed. Let $\textbf{p}_1$ and $\textbf{p}_2$ be points on line $A$ and $\textbf{q}$ be a point on line $B$. Then $d(A,B)$, the distance between lines $A$ and $B$ can be quickly found using the expression
$$d(A,B)=\left|(\textbf{q}-\textbf{p}_1)-\frac{(\textbf{q}-\textbf{p}_1)\cdot(\textbf{p}_2-\textbf{p}_1)}{|\textbf{p}_2-\textbf{p}_1|^2}(\textbf{p}_2-\textbf{p}_1)\right|$$
The reasoning here is that we want to take a vector which connects the two lines and decompose it into the component which is orthogonal to the lines and the component which is parallel. We therefore take the orthogonal projection (the component which is parallel to the lines) of the vector $\textbf{q}-\textbf{p}_1$  and subtract it from $\textbf{q}-\textbf{p}_1$ to find the vector we were looking for (the one orthogonal to the lines which connects them). We are interested in the magnitude of this vector and so we take the magnitude of this vector.
Good question! Let me know if the reasoning here is in any way unclear.
A: If you know the lines are parallel, you can solve the problem using the formula for the distance between a point and a line: form a vector from a point on the first line to a point on the second line and cross it with the normalized direction vector of one of the lines.
I.e., if $P$ is on the first line, $Q$ is on the second line, and $u$ is the normalized direction vector of one of the lines (so it has unit length), the distance between the lines is $\lVert PQ \times u \rVert$.
EDIT: if the direction vector does not have unit length, the formula is $$\frac{\lVert PQ \times u\rVert}{\lVert u\rVert}.$$
A: 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:

