Line–line intersection
Consider the two lines defined by
$\overrightarrow{r}={\overrightarrow{r}}_{0}+t\overrightarrow{m}$ and $\overrightarrow{s}={\overrightarrow{s}}_{0}+p\overrightarrow{n}\text{.}$
These lines may or may not intersect. In ${\mathbb{R}}^{2}\text{,}$ their are three cases:
- collinear ($\infty $)
- The two lines are equal. Formally, $\forall t\text{}\exists p$ such that $\overrightarrow{r}=\overrightarrow{s}\text{.}$ This implies that $\overrightarrow{m}=k\overrightarrow{n}\text{,}$ 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 ${\overrightarrow{s}}_{0}=\overrightarrow{r}$ and ${\overrightarrow{r}}_{0}=\overrightarrow{s}\text{.}$ There are $\infty $ points of intersection.
- parallel (0)
- The two lines are parallel, so $\overrightarrow{m}=k\overrightarrow{n}\text{,}$ but they are not collinear. For all combinations of values of t and p, $\overrightarrow{r}\ne \overrightarrow{s}\text{.}$ The lines never intersect.
- nonparallel (1)
- All other systems fall into this category. The lines are nonparallel, so $\overrightarrow{m}\ne k\overrightarrow{n}\text{.}$ There is exactly one point of intersection.
In ${\mathbb{R}}^{3}\text{,}$ 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 $y=mx+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 ${\mathbb{R}}^{3}\text{,}$ 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 $\text{LS}=\text{RS}\text{,}$ 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.