GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 8 / 0 / 8
Functions: 100.0% 1 / 0 / 1
Branches: 91.7% 11 / 0 / 12

src/geo2d/tan/cc_in/lib.hpp
Line Branch Exec Source
1 #pragma once
2
3 #include "../../ds/c/lib.hpp"
4 #include "../../ds/l/lib.hpp"
5 #include "../cp/lib.hpp"
6
7 namespace tifa_libs {
8
9 // internal tagante lines of 2 disjoint circles
10 // maybe 0, 2 (maybe duplicate)
11 template <class FP>
12 40 CEXP auto intan_CC(circle<FP> CR c1, circle<FP> CR c2) NE {
13 40 std::optional<ptt<line<FP>>> ret;
14
6/6
✓ Branch 1 taken 9 times.
✓ Branch 2 taken 31 times.
✓ Branch 4 taken 1 time.
✓ Branch 5 taken 8 times.
✓ Branch 6 taken 1 time.
✓ Branch 7 taken 39 times.
40 if (is_eq(c1.o.x, c2.o.x) && is_eq(c1.o.y, c2.o.y)) return ret;
15 39 const point p = (c1.o * c2.r + c2.o * c1.r) / (c1.r + c2.r);
16 39 const auto ps = tan_CP(c1, p), qs = tan_CP(c2, p);
17
5/6
✓ Branch 1 taken 22 times.
✓ Branch 2 taken 17 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 22 times.
✓ Branch 6 taken 17 times.
✓ Branch 7 taken 22 times.
39 if (!ps || !qs) return ret;
18 // c1 counter-clock wise
19 22 ret.emplace(line{ps->first, qs->first}, line{ps->second, qs->second});
20 22 return ret;
21 }
22
23 } // namespace tifa_libs
24