| 42 | { |
| 43 | template < geode::index_t dimension > |
| 44 | double compute_angle( const geode::Point< dimension >& point, |
| 45 | const geode::Point< dimension >& point_prev, |
| 46 | const geode::Point< dimension >& point_next ) |
| 47 | { |
| 48 | const auto prev = |
| 49 | geode::Vector< dimension >{ point, point_prev }.normalize(); |
| 50 | const auto next = |
| 51 | geode::Vector< dimension >{ point, point_next }.normalize(); |
| 52 | const auto dot = std::clamp( prev.dot( next ), -1.0, 1.0 ); |
| 53 | const auto angle = std::acos( dot ); |
| 54 | if( std::isnan( angle ) ) |
| 55 | { |
| 56 | return 0; |
| 57 | } |
| 58 | return angle; |
| 59 | } |
| 60 | |
| 61 | std::array< geode::local_index_t, 3 > lu_decomposition( |
| 62 | geode::SquareMatrix3D& matrix ) |
no test coverage detected