src/geo2d/tcenter/i/lib.hpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include "../../ds/t/lib.hpp" | ||
| 4 | |||
| 5 | namespace tifa_libs { | ||
| 6 | |||
| 7 | // radius of inscribed circle | ||
| 8 | template <class FP> | ||
| 9 | 141 | CEXP FP radius_I(triangle<FP> CR t) NE { | |
| 10 | 141 | auto [a, b, c] = t.edges(); | |
| 11 | 141 | return 2 * t.area() / (a + b + c); | |
| 12 | } | ||
| 13 | // incenter (X1) | ||
| 14 | template <class FP> | ||
| 15 | 145 | CEXP point<FP> center_I(triangle<FP> CR t) NE { return t.trilinears(1, 1, 1); } | |
| 16 | |||
| 17 | } // namespace tifa_libs | ||
| 18 |