src/geo2d/cross/lib.hpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include "../../util/func_fp/lib.hpp" | ||
| 4 | |||
| 5 | namespace tifa_libs { | ||
| 6 | |||
| 7 | template <class P> | ||
| 8 | 157890240 | CEXP auto cross(P CR o, P CR a, P CR b) NE { return (a - o) ^ (b - o); } | |
| 9 | template <class P> | ||
| 10 | requires std::floating_point<TPN P::FP_t> | ||
| 11 | 1063438164 | CEXP auto cross_unit(P CR o, P CR a, P CR b) NE { return (a - o).do_unit() ^ (b - o).do_unit(); } | |
| 12 | template <class P> | ||
| 13 | requires std::floating_point<TPN P::FP_t> | ||
| 14 | 1063438160 | CEXP int sgn_cross(P CR o, P CR a, P CR b) NE { return sgn(cross_unit(o, a, b)); } | |
| 15 | template <class P> | ||
| 16 | 27895679 | CEXP int sgn_cross(P CR o, P CR a, P CR b) NE { return sgn(cross(o, a, b)); } | |
| 17 | |||
| 18 | } // namespace tifa_libs | ||
| 19 |