Where do these determinants come from for line intersection?

454 Views Asked by At

I was in need of a method to compute the intersection of two lines given two points along each line. While searching for such a method, I came across one on Wikipedia that listed the results from determinants. It however does not show how these determinants were derived. I would like to know how they were derived and not just blindly use the method without understanding it.

To clarify, I am not asking how the final version of $(P_{x}, P_{y})$ is derived; thats just the cross product of the determinants themselves. Rather, how did the original determinants come to be? What was the linear system when given 4 points, 2 for each line?

2

There are 2 best solutions below

3
On

Suppose we have that $(x_1,y_1)$ and $(x_2,y_2)$ determine the line $a_1 x+b_1 y+c_1=0$.

Now write $u_1:=(x_1,y_1,1)$ and $u_2:=(x_2,y_2,1)$, and $w_1:=(a_1,b_1,c_1)$.

Then we have $w_1 \cdot u_1 =0$ and $w_1 \cdot u_2 =0$. Hence $w_1$ is parallel to the cross product $u_1\wedge u_2$.

For the second line $a_2 x+b_2 y+c_2=0$ we have $u_3:=(x_3,y_3,1)$ and $u_4:=(x_4,y_4,1)$, and $w_2:=(a_2,b_2,c_2)$. Hence $w_2$ is parallel to $u_3\wedge u_4$.

The common point $(x,y)$ of the two lines is got by considering $p:=(x,y,1)$. We have that $w_1 \cdot p=0$ and $w_2 \cdot p=0$, so that $p$ is parallel to $w_1 \wedge w_2$.

That is $p=\lambda[ (x_1 \wedge x_2) \wedge (x_3 \wedge x_4)]$, where $\lambda$ is chosen to ensure the third component of $p$ is $1$.

If you use the usual expression for a cross-product as a triple of $2\times 2$ determinants you'll easily see where all the terms in the expression you reference come from.

1
On

Here's an attempt at the (usually inadvisable) approach of reverse-engineering the systems of equations from the solutions. We have $$ P_x = \frac{\begin{vmatrix} \begin{vmatrix} x_1 & y_1\\x_2 & y_2\end{vmatrix} & \begin{vmatrix} x_1 & 1\\x_2 & 1\end{vmatrix} \\\\ \begin{vmatrix} x_3 & y_3\\x_4 & y_4\end{vmatrix} & \begin{vmatrix} x_3 & 1\\x_4 & 1\end{vmatrix} \end{vmatrix} } {\begin{vmatrix} \begin{vmatrix} x_1 & 1\\x_2 & 1\end{vmatrix} & \begin{vmatrix} y_1 & 1\\y_2 & 1\end{vmatrix} \\\\ \begin{vmatrix} x_3 & 1\\x_4 & 1\end{vmatrix} & \begin{vmatrix} y_3 & 1\\y_4 & 1\end{vmatrix} \end{vmatrix}} = - \frac{\begin{vmatrix} \begin{vmatrix} x_1 & 1\\x_2 & 1\end{vmatrix} & \begin{vmatrix} x_1 & y_1\\x_2 & y_2\end{vmatrix} \\\\ \begin{vmatrix} x_3 & 1\\x_4 & 1\end{vmatrix} & \begin{vmatrix} x_3 & y_3\\x_4 & y_4\end{vmatrix}\end{vmatrix} } {\begin{vmatrix} \begin{vmatrix} x_1 & 1\\x_2 & 1\end{vmatrix} & \begin{vmatrix} y_1 & 1\\y_2 & 1\end{vmatrix} \\\\ \begin{vmatrix} x_3 & 1\\x_4 & 1\end{vmatrix} & \begin{vmatrix} y_3 & 1\\y_4 & 1\end{vmatrix} \end{vmatrix}} $$ and $$ P_y = \frac{\begin{vmatrix} \begin{vmatrix} x_1 & y_1\\x_2 & y_2\end{vmatrix} & \begin{vmatrix} y_1 & 1\\y_2 & 1\end{vmatrix} \\\\ \begin{vmatrix} x_3 & y_3\\x_4 & y_4\end{vmatrix} & \begin{vmatrix} y_3 & 1\\y_4 & 1\end{vmatrix} \end{vmatrix} } {\begin{vmatrix} \begin{vmatrix} x_1 & 1\\x_2 & 1\end{vmatrix} & \begin{vmatrix} y_1 & 1\\y_2 & 1\end{vmatrix} \\\\ \begin{vmatrix} x_3 & 1\\x_4 & 1\end{vmatrix} & \begin{vmatrix} y_3 & 1\\y_4 & 1\end{vmatrix} \end{vmatrix}}. $$ By Cramer's rule, this means that $P_x,P_y$ solve the system of equations $$ \pmatrix{ \begin{vmatrix} x_1 & 1\\x_2 & 1\end{vmatrix} & \begin{vmatrix} y_1 & 1\\y_2 & 1\end{vmatrix} \\\\ \begin{vmatrix} x_3 & 1\\x_4 & 1\end{vmatrix} & \begin{vmatrix} y_3 & 1\\y_4 & 1\end{vmatrix} } \pmatrix{P_y\\ -P_x} = \pmatrix{ \begin{vmatrix} x_1 & y_1\\ x_2 & y_2\end{vmatrix}\\ \\ \begin{vmatrix} x_3 & y_3\\x_4 & y_4\end{vmatrix}} $$ which is to say that $$ \begin{vmatrix} x_1 & 1\\x_2 & 1\end{vmatrix} P_y - \begin{vmatrix} y_1 & 1\\y_2 & 1\end{vmatrix} P_x = \begin{vmatrix} x_1 & y_1\\ x_2 & y_2\end{vmatrix}\\ \\ \phantom{1}\\ \begin{vmatrix} x_3 & 1\\x_4 & 1\end{vmatrix} P_y - \begin{vmatrix} y_3 & 1\\y_4 & 1\end{vmatrix} P_x = \begin{vmatrix} x_3 & y_3\\x_4 & y_4\end{vmatrix}. $$

Since other answers are appearing, I'll stop there.