
As you may know, three independent linear equations in three variables (which I will call x, y, and z to represent the three axes) has a single solution; they represent a point. If you are given only two independent linear equations in these three variables, they will have infinitely many solutions, but what is the "shape" of those solutions? To understand the shape, think about "pinning down" one of the variables, say, x. When x has a specific value, say, x=c, then you can solve for y and z. In other words, the plane represented by x=c intersects the shape in one point. This is true also for all the planes parallel to x=c. What shape intersects all parallel planes in one point each? A line, of course. And finally, if you have only one linear equation in three variables, this represents a plane. So here is the summary:
Number of 
Shape of the 
3 
point 
2  line 
1  plane 
0  space 
If you are given the equations of a line as
(xx_{0})/x_{1} = (yy_{0})/y_{1} = (zz_{0})/z_{1}
Then you can make a parameter, t, equal to each of these, as
(xx_{0})/x_{1} = (yy_{0})/y_{1} = (zz_{0})/z_{1} = t
Then this is easily converted to the vector equation
( x ) ( x_{0} ) ( x_{1} ) r = y = y_{0} + t y_{1} z z_{0} z_{1}
If you are given a pair of equations in three variables
ax + by + cz = d
fx + gy + hz = j
Then you should eliminate one of the variables, say, z, and let that be your parameter. This gives you
t = z, and
x = ( (dgjb) + t(bhcg) ) / (agbf)
y = ((dfja) + t(cfah) ) / (agbf)
z = ( 0 + t(agbf) ) / (agbf)
I would love to find a more "parallel" way of converting a pair of linear equations into a set of parametric equations. Email me! . . . . . .
Expressing the two lines, L_{1} and L_{2}, in parametric form where r,a,b,c,d are vectors, and s,t are scalar parameters,
(L_{1}) r = a + bs,
(L_{2}) r = c + dt,
then the distance between the two lines is given by
g = (ac)·(b×d) / b×d
Why does this formula work?
Recall that the dot product of two vectors can be viewed geometrically as the length of the projection of the first vector onto the line represented by the second vector times the length of the second vector. This is particularly useful when the second vector is a unit vector. In this case, if you extend the second vector and think of it as a "base", then rays of light falling perpendicular to the base will pass through the first vector, and cast a shadow onto the base whose length is the dot product of the two vectors. Also, recall that the cross product of two vectors a,b is a vector whose direction is orthogonal to both a and b.
Now picture lines L_{1} and L_{2} as having "directions" represented respectively by vectors b and d. The direction that is orthogonal to both b and d is given by b×d. The unit vector, u, in this direction is u=b×d/b×d. Now orient your perspective so that L_{1} and L_{2} lie in parallel planes P_{1} and P_{2}. The distance between the lines, then, is the distances between the planes, measured in a direction normal to the planes, i.e. measured in the direction given by vector u, which is perpendicular to L_{1} and L_{2} and thus normal to the planes.
Now, from the parametric equations of the two lines, we know that vectors a and c can be construed (using the point  vector duality) as represent points on lines L_{1} and L_{2}. The difference between them (ac) is a vector giving the distance between the planes P_{1} and P_{2} in some direction, but not necessarily in a direction orthogonal to the planes. So we have a vector (ac) whose length in some direction is the distance between the planes, and we have another vector, u=b×d/b×d, whose direction is normal to both planes. Now, we just need to cast the shadow of (ac) onto the line containing u, and find its length! Of course, the dot product does that job for us.
Now you might also want to find the particular points on L_{1} and L_{2} where the lines come closest to each other. For that, let line L_{3} be the projection of line L_{1} onto plane P_{2}. We have already calculated
u = (b×d) / b×d, the vector giving the direction from a point on P_{1} toward its shadow on P_{2}.
and
g = (ac)·u, the orthogonal distance from P_{1} to P_{2}.
Now,
(L_{3}) r = g u + a + bs, and as a reminder,
(L_{2}) r = c + dt,
So now we can solve (g u + a) + bs = c + dt for s,t to find r. We can use any two components of the vectors to make two linear equations in the two variables s,t in order to solve the equation.
Finding the distance between a line and a point.
Vectors, and their dot product, cross product.
The webmaster and author of this Math Help site is Graeme McRae.