GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 5 / 0 / 5
Functions: -% 0 / 1 / 1
Branches: -% 0 / 0 / 0

src/geo2d/area_triedges/lib.hpp
Line Branch Exec Source
1 #pragma once
2
3 #include "../../util/util/lib.hpp"
4
5 namespace tifa_libs {
6
7 // calculate area of triangle by the length of 3 edges
8 // numerical stability improved
9 template <class FP>
10 4 CEXP FP area_T_abc(FP a, FP b, FP c) NE {
11 4 if (a < b) swap(a, b);
12 4 if (a < c) swap(a, c);
13 4 if (b < c) swap(b, c);
14 4 return std::sqrt(a + (b + c)) * std::sqrt(c - (a - b)) * std::sqrt(c + (a - b)) * std::sqrt(a + (b - c)) / 4;
15 }
16
17 } // namespace tifa_libs
18