Line–line intersection
Consider the two lines defined by
$\displaystyle \vec{r} = \vec{r}_{0} + t \vec{m} \qquad \allowbreak\quad\allowbreak\text{and}\allowbreak\quad\allowbreak \qquad \vec{s} = \vec{s}_{0} + p \vec{n}$.
These lines may or may not intersect. In $\displaystyle \mathbb{R}^{2}$, their are three cases:
- collinear ($\displaystyle \infty$)
- The two lines are equal. Formally, $\displaystyle \forall t \, \exists p$ such that $\displaystyle \vec{r} = \vec{s}$. This implies that $\displaystyle \vec{m} = k \vec{n}$, meaning the direction vectors are scalar multiples of each other. The initial points need not be equal, but each must lie on the other line: there must exist values of t and s such that $\displaystyle \vec{s}_{0} = \vec{r}$ and $\displaystyle \vec{r}_{0} = \vec{s}$. There are $\displaystyle \infty$ points of intersection.
- parallel (0)
- The two lines are parallel, so $\displaystyle \vec{m} = k \vec{n}$, but they are not collinear. For all combinations of values of t and p, $\displaystyle \vec{r} \ne \vec{s}$. The lines never intersect.
- nonparallel (1)
- All other systems fall into this category. The lines are nonparallel, so $\displaystyle \vec{m} \ne k \vec{n}$. There is exactly one point of intersection.
In $\displaystyle \mathbb{R}^{3}$, there is one more possibility: skew lines. These are lines that are nonparallel but do not intersect. To see how this is possible, simply point your arms in different directions. Unless you deliberately put them on the same plane, they will not intersect even when extended to infinity.
Finding the point of intersection for two lines in two-space in $\displaystyle y = m x + b$ form is easy: all you have to do is solve a linear system. With these new types of equations, it’s a bit more work. To find the point(s) of intersection of two lines in $\displaystyle \mathbb{R}^{3}$, follow these steps:
- Express both lines with parametric equations using different variables for the free parameters, such as t and p.
- Set the right-hand sides of the x equations equal. Do the same for y and z. Now you have a system of three equations.
- Choose two of the equations and solve the system for t and p. You will be unable to do this if the lines are collinear or parallel.
- Perform an LS/RS verification of the as yet unused equation with the values of t and p that you just found.
- If $\displaystyle \text{LS} = \text{RS}$, the system is consistent. If not, the system is inconsistent and the line are skew.
- If the system was consistent, substitute the value of t or p into the parametric equations of its line to find the point of intersection.
- For extra verification, substitute the other free parameter into the other line equations and make sure you get the same point.