| 70 | O = A + ((B - A) / (s1 + ((D - B) * (C - B) % normal))) * s1; |
| 71 | return 1; } |
| 72 | int line_plane_intersect(L(A, B), PL(C, D, E), point3d & O) { |
| 73 | double V1 = (C - A) * (D - A) % (E - A); |
| 74 | double V2 = (D - B) * (C - B) % (E - B); |
| 75 | if (abs(V1 + V2) < EPS) |
| 76 | return A.isOnPlane(C, D, E) ? 2 : 0; |
| 77 | O = A + ((B - A) / (V1 + V2)) * V1; |
| 78 | return 1; } |
| 79 | bool plane_plane_intersect(P(A), P(nA), P(B), P(nB), |
| 80 | point3d &P, point3d &Q) { |
| 81 | point3d n = nA * nB; |