Line |
Plane.intersect(Plane rhs) |
find the intersection line of 2 planes
// P1: N1 dot p + d1 = 0 (a1*X + b1*Y + c1*Z + d1 = 0)
// P2: N2 dot p + d2 = 0 (a2*X + b2*Y + c2*Z + d2 = 0)
//
// L: p0 + a*V where
// V is the direction vector of intersection line = (a1,b1,c1) x (a2,b2,c2)
// p0 is a point, which is on the L and both P1 and P2 as well
//
// p0 can be found by solving a linear system of 3 planes
// P1: N1 dot p + d1 = 0 (given)
// P2: N2 dot p + d2 = 0 (given)
// P3: V dot p = 0 (chosen where d3=0)
//
// Use the formula for intersecting 3 planes to find p0;
// p0 = ((-d1*N2 + d2*N1) x V) / V dot V
|