Distance between two parallel lines?

Apr 2010
How do you find the distance between two parallel line who equations are given in the form
r= ai+bj+ck + s(xi+yj+zk)
May 2010
Long way:
the shortest distance between the two parallel lines will be on a line that is perpendicular to both (and that passes through both).

You can use this to get the coordinates of 2 points that are at the minimum distance from each other, find the distance between those two points to get answer you want.

Possibly Shorter way (requires calculus):
Pick a point on one of your lines \(\displaystyle x_1,y_1,z_1 \)

Note that every point on your second line satisfies \(\displaystyle (x_2,y_2,z_2) + a(m_x,m_y,m_z) \) where a is a constant, the m's are the slope paramters of your second line, and \(\displaystyle (x_2,y_2,z_3)\) is a known point on your second line

Setup a lagrangian to minimise the distance between \(\displaystyle x_1,y_1,z_1 \) and \(\displaystyle (x_2,y_2,z_2) + a(m_x,m_y,m_z)\) by choosing a.

This minimum distance is the distance you want.
Last edited:


MHF Helper
Apr 2005
Then don't use that method! Instead, use the "long way" SpringFan25 mentions:

Also, "r= ai+bj+ck + s(xi+yj+zk)" is an unfortunate way to write the line because the x, y, and z in that are simply coefficients, NOT the (x, y, z) coordinates of a point. I am going to write instead "r= xi+yj+ zk= ai+bj+ ck+ s(Ai+ Bj+ Ck)" so that (x, y, z)= (a+ sA, b+ sB, c+ sC).

Now you know that Ai+ Bj+ Ck is a vector pointing in the direction of the line. A planeperpendicular to the line is given by \(\displaystyle A(x- x_0)+ B(y- y_0)+ C(z- z_0)= 0\) where \(\displaystyle (x_0, y_0, z_0)[/itex] is any point on the line (take s to be any value- 0 for example).

Now, the point on the second line closest to the first line is where that second line crosses that plane. Put the (x, y, z) values given by the equation of the second line, in terms of some parameter, t, into the equation of the plane to find t and then the point.

Finally, find the distance between those two points.\)


MHF Hall of Honor
Jan 2006
i haven't studied lagrangian yet
Here is a slightly different approach:

1. You are supposed to know that the absolute value of the cross-product of vectors equals the area which is spanned by the 2 vectors.

2. Since the area of a parallelogram is calculated by:

\(\displaystyle A = |base| \cdot |height|\)

you'll get the height (= the distance between the parallel lines!) if you divide the area by the length of the base.

3. According to my sketch the height is \(\displaystyle h = \frac{|(\vec q - \vec p) \times \vec v|}{|\vec v|}\)


Last edited: