src/geo2d/pred/is_ins_sl/lib.hpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include "../../ds/l/lib.hpp" | ||
| 4 | |||
| 5 | namespace tifa_libs { | ||
| 6 | |||
| 7 | // judge if segment and line are intersected | ||
| 8 | template <class FP, bool contain_endpoints = true> | ||
| 9 | 285538310 | CEXP bool is_ins_SL(line<FP> CR s, line<FP> CR l) NE { | |
| 10 | 285538310 | const auto a = l.toleft(s.l), b = l.toleft(s.r); | |
| 11 |
6/6✓ Branch 0 taken 285535084 times.
✓ Branch 1 taken 3226 times.
✓ Branch 2 taken 285531858 times.
✓ Branch 3 taken 3226 times.
✓ Branch 4 taken 47553486 times.
✓ Branch 5 taken 237978372 times.
|
285538310 | if CEXP (contain_endpoints) return !a || !b || a != b; |
| 12 | else return a && b && !(a + b); | ||
| 13 | } | ||
| 14 | |||
| 15 | } // namespace tifa_libs | ||
| 16 |