MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / line_plane_intersect

Function line_plane_intersect

code/geometry/primitives3d.cpp:72–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70 O = A + ((B - A) / (s1 + ((D - B) * (C - B) % normal))) * s1;
71 return 1; }
72int 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; }
79bool plane_plane_intersect(P(A), P(nA), P(B), P(nB),
80 point3d &P, point3d &Q) {
81 point3d n = nA * nB;

Callers

nothing calls this directly

Calls 1

isOnPlaneMethod · 0.80

Tested by

no test coverage detected