Intersection of Lines in 3D
Aims: By the end of this note, you will be able to
 classify different sort of lines both in 2D and in 3D, and
 use vector representation of line to solve the following cases: intersections, shortest distance, parallel and skew lines.
Intoduction
Given two lines in 3D space, they may satisfy one of the following conditions:
 intersect at a point
 be parallel to each other and do not intersect
 be parallel and coincident (i.e. two lines are the same, all points satisfy both linear equations)
 be neither parallel nor intersect (skew lines).
To intersect at a point or coincident, the two lines must be on the same plane.
Lines that are lying in the same plane are called coplanar lines. Cases 1, 2 and 3 above are coplanar or on the same plane. Two lines that are parallel are also coplanar lines.
Skew lines on the other hand do not share the same plane. You can think of one line in the first floor and the other in the 25th floor so that they will never meet. Thus, two lines in 2D cannot be skews.
Questions in this section may involve you to test whether two lines are parallel or perpendicular to each other.
Recall that given two nonzero vectors \( \vec{a} \) and \( \vec{b} \) then they are

Example 1:
Find the point of intersection between line L1 and L2 whose vector equations
are
\( \vec{r_1} = \left(\begin{matrix} 2 \\ 1 \\ 2 \end{matrix}\right) + \lambda \left(\begin{matrix} 6 \\ 8 \\ 10 \end{matrix}\right) \) and
\( \vec{r_2} =\left( \begin{matrix} 1 \\ 10 \\ 5 \end{matrix}\right) + \mu \left(\begin{matrix} 6 \\ 7 \\ 2 \end{matrix} \right) \) respectively.
Solution
For these two lines to intersect there must be a value of λ and μ
that will provide a point that lies both on L1 and L2. The strategy is to solve
for λ and μ. Next we have to make
sure the point satisfies both \( \vec{r_1} \) and \( \vec{r_2} \).
Equating coordinates x, y, and z allow us to have the following system of equations:
2 + 6λ = 1 + 6μ (1)
1  8λ = 10 + 7μ (2)
2 + 10λ = 5  2μ (3)
Solving this system using (1) and (3) simultaneously, for example, allow us
to obtain
λ = 1/2 and μ = 1.
Substituting λ = 1/2 and μ = 1 into (1), (2) and (3) gives us the
point of intersection at (5, 3, 3).
Remember. Once you found λ and μ then make sure you that xcoordinates, ycoordinates, and zcoordinates of both lines are equal. If they are all equal then you have at least one intersection. If at least one of the coordinates be it x, y or z are different between the two lines then they have no intersection. Study example 4 below. 
Example 2
Find the point of intersection between line L1 and L2 whose Cartesian equations
are
L1: \( \large \frac{x3}{2} = \frac{y+2}{1} = \frac{z}{3} \) and
L2: \( \large \frac{x+1}{1} = \frac{y2}{1} = \frac{z4}{9} \) respectively.
Solution.
From L1, we obtain the following:
x = 3 + 2λ (1)
y = 2  λ (2)
z = 3λ
(3)
Similarly from L2 we have
x = 1+ μ (4)
y = 2 + μ (5)
z = 4 + 9μ (6)
Equate (1) to (4) and (2) to (5) and solve this system simultaneously to obtain
λ = 8/3 and μ
= 4/3.
Substituting λ = 8/3 into (1), (2) and
(3) and μ = 4/3 into (4), (5) and (6) gives
us the point of intersection at (7/3, 2/3, 8).
Shortest distance from a point to a line (2D or 3D)
Let A be a point in 3D space and \( d \) be the shortest
distance from the point A to a line represented by vector \( \vec{b} \).

However, most questions may not come with as much information as the diagram above. Usually, the angle is unknown. Let \( A(x_1,y_1,z_1) \) be a known point that
is fixed and image P to be a point moving in the direction of vector \( \vec{b} \)
as shown in this diagram. Vector \( \vec{b} \) is
\( \left( \begin{matrix} b_1 \\ b_2 \\b_3 \end{matrix} \right) \)
The shortest distance \(d\) between A and \( \vec{b} \) occurs
when P is moved into a position such that vector \( \vec{AP} \) is perpendicular to
\( \vec{b} \). Thus, the strategy is to find the value \(t\) where 
Example 3
Find the shortest distance from A(5,2,2) to the line \( \large \frac{x+5}{1} = \frac{y+7}{2} = \frac{z14}{3} \) .
Solution
Any point P on the line has coordinates
x = 5 + λ
y = 7 + 2λ
z = 14  3λ.
Moreover, the direction vector of the line, say \( \vec{b} = \vec{i}+2\vec{j}3\vec{k} \)
Then
\(\begin{align} \vec{AP} & = \vec{AO} + \vec{OP} \\
& = \left(\begin{matrix}
5 5 + \lambda \\
2 7 + 2 \lambda \\
2 + 14  3\lambda
\end{matrix}
\right) \\
& = \left(\begin{matrix}
\lambda \\
5 + 2 \lambda \\
12  3\lambda
\end{matrix}
\right) \\
\end{align} \)
The shortest distance occurs at a λ such that the scalar
product between \(\vec{AP} \) and \( \vec{b} \) is zero. Thus, we set
\(\begin{align} \vec{AP} \bullet \vec{b} & = 0 \\
& = \left(\begin{matrix}
\lambda \\
5 + 2 \lambda \\
12  3\lambda
\end{matrix}
\right) \bullet
\left(\begin{matrix}
1 \\
2 \\
3
\end{matrix}
\right) \\
\implies 14\lambda  46 & = 0 \\
\implies \lambda & = \frac{23}{7}
\end{align} \)
The vector \( \vec{AP} \) associated with the shortest distance is
\(\begin{align} \vec{AP*} & = \left( \begin{matrix} \frac{23}{7} \\ \frac{11}{7}
\\ \frac{15}{7} \end{matrix} \right) \\ \vec{AP*} &= \sqrt{(\frac{23}{7})^2+(\frac{11}{7})^2+(\frac{15}{7})^2}
\\ &= \frac{\sqrt{125}}{7} \end{align} \)
Thus, the shortest distance from A(5,2,2) to the line \( \frac{x+5}{1}
= \frac{y+7}{2} = \frac{z14}{3} \) is \( \frac{\sqrt{125}}{7} \).
Example 4.
Let two straight lines be
L1 : \( \left( \vec{i} + 2 \vec{j}  \vec{k} \right) + \lambda \left( 5
\vec{i}  3 \vec{j} + 2\vec{k} \right) \) and
L2 : \( \left( 10 \vec{i} 5 \vec{j} +3\vec{k} \right) + \mu \left( 7\vec{i}
+ 8\vec{j} 3\vec{k} \right) \)
respectively.
Show that L1 and L2 are skew lines.
Solution.
We will need to show that (1) L1 and L2 are not parallel to each other. That
is, the set of coefficients of the direction vector in L1 and L2 are not proportional.
(2) Next we need to show that L1 and L2 do not intersect at any point. With
these two conditions, we can establish that L1 and L2 are skew lines.
Let us first consider the set of directional vectors of L1 and L2. The ratio of the coefficients of the \( \vec{i} \) basis is 5/7. Similarly, those for \( \vec{j} \) basis and \( \vec{k} \) basis are 3/8 and 2/(3) respectively. However, these ratios do not equate to each other. Thus, we can conclude that L1 and L2 are not parallel.
The next step is to show that these lines have no intersection. We will start
by assuming that these two lines actually intersect at a point and show that
this lead to a contradiction. From L1 we obtain
x = 1 + 5λ (1)
y = 2  3λ (2)
z = 1 + 2λ (3)
Similarly from L2 we have
x = 10 + 7μ (4)
y = 5 + 8μ(5)
z = 3  3μ (6)
Equate (1) to (4) and (2) to (5) and solve this system simultaneously to obtain
λ = 121/61 and μ = 8/61
[Note the system above can be easily solved using Polysmlt apps in the Ticalculator
and remember to change your answer into fraction..]
Substituting λ = 121/61 into (3) and μ = 8/61 into (6) gives 181/61
and 159/61 respectively.
Since these xcoordinates do not equal, these lines do not intersect.
[Notice that (3) and (6) were subjected to the test because they were not
used to solve for λ and μ. ]
Since L1 and L2 are not parallel and do not intersect then L1 and L2 must be
skew lines.