# Point of intersection line of two planes

$Plane1$ is defined by a point $origin1$ and a unit normal vector $normal1$.

$Plane2$ is defined by a point $origin2$ and a unit normal vector $normal2$.

The direction vector of the line of intersection is $vector = {(normal1 \times normal2) \over ||normal1 \times normal2||}$

Let $P=(x, y, 0)$ be a point on the line of intersection.

$$d1 = -(normal1 \cdot origin1)\\ d2 = -(normal2 \cdot origin2)\\ x = {\det\begin{pmatrix}normal1_Y&d1\\normal2_Y&d2\end{pmatrix} \over vector_Z}\\ y = {\det\begin{pmatrix}d1&normal1_X\\d2&normal2_X\end{pmatrix} \over vector_Z}$$

I wrote the code for the whole thing, however, the resulting $x$ and $y$ are wrong.

e.g.:

$origin1 = (5.068435, 8.175731, 6.636723)\\ normal1 = (0.06843487, -0.02417875, -0.01889595)\\ origin2 = (5.15494, 8.304083, 6.409493)\\ normal2 = (0.003429738, -0.0473366, 0.05807309)\\ x = 0.00213990043475194\\ y = 0.00053338281461705$

Expected result (approximately):

$x = 0.3809\\ y = 0.0949$

• How do you know that the line of intersection itself intersects the $x$-$y$ plane? – amd Jun 4 '17 at 19:25
• @amd given that the result of computing $vector$ is $(-0.4091549, -0.7189537, -0.56187)$ its z component is not null, it is then possible to assume that z=0 to solve the system – R. 久蔵 Jun 4 '17 at 19:28

It looks like you’re using a form of Cramer’s rule to find the intersection point. Your error lies in normalizing the direction vector of the line for the denominators. If you divide your result by $\|normal_1\times normal_2\|$ you’ll get the correct result, but that’s the same as not normalizing in the first place.
• Thanks. The normalization step was introduced in case $vector$ was too small. – R. 久蔵 Jun 4 '17 at 20:28