PDA

View Full Version : Determining the line intersecting two planes


doonzy
Aug11-10, 01:35 PM
Hello,

Given two planes, P1 and P2, I would like to determine their line of intersection L. I know three points that lie on each plane: (p1, p2, p3) for P1, and (q1, q2, q3) for P2.

Based on what I am doing (triangle collision detection in 3D) it would be convenient to have L defined as a direction vector and a point.

Thank you.

adriank
Aug11-10, 09:14 PM
If you rewrite your planes as equations
P1: a1x + b1y + c1z = d1
P2: a2x + b2y + c2z = d2
then using basic linear algebra you can find the set of solutions, which will have one parameter if the two planes intersect in a line (that is, the matrix
\begin{pmatrix} a_1 & b_1 & c_1 \\ a_2 & b_2 & c_2 \end{pmatrix}
has rank 2).

Alternatively: Two planes intersect in a line if and only if the cross product of their normal vectors is nonzero. In this case, the cross product gives the direction of the line. You are still left with the problem of finding a point on the line, though.