0

How to find the intersection point of two lines in Euclidean space if the lines are:

$$\textbf{l}_1 = \textbf{n}_1t + \textbf{d}_1 \\ \textbf{l}_2 = \textbf{n}_2s + \textbf{d}_2$$

here $\textbf{n}$ - direction vector parallel to the line $\textbf{l}$; $\textbf{d}$ - point belonging to the line $\textbf{l}$; $s$,$t$ - real type variables.

Assumption that lines intersect holds.

I saw similar questions for 3d space like Intersection between two lines, but I need general equations for any dimension.

niekas
  • 233

2 Answers2

2

You set up the equation $\textbf{l}_1 = \textbf{l}_2$. The components of the two vectors make this a set of equations in the two unknowns $s$ and $t$. Once you've figured out what $s$ and $t$ are at the intersection point (i.e. solved that set of equations), you use one of them to figure the coordinates from one of the lines.

Note that in higher dimension, the condition that the lines do indeed intersect is the same as the condition that all equations can be solved with one value for $s$ and one value for $t$.

Arthur
  • 199,419
  • Ok, but the set of equations can be written as one equation with some kind of matrix. I want to know the exact expresion of intersection point $\textbf{p}_i = ...$. – niekas Sep 24 '14 at 09:23
1

The intersection point must statisfy $\mathbb l_1(t)-\mathbb l_2(s)=0$. This give use something to solve: \begin{align*} 0&=\mathbf l_1(t)-\mathbf l_2(s) \\ &=\mathbf n_1t+\mathbf d_1-\mathbf n_2s-\mathbf l_2 \end{align*}

This is a set of linear equation (one for each dimension) which you can solve for the intersection points.

Dom
  • 1,378