| 968 | }; |
| 969 | |
| 970 | DDir unit(const DDir& a) { |
| 971 | auto n = std::sqrt(a.squared_length()); |
| 972 | if (n < 1.e-9) { |
| 973 | return {0., 0.}; |
| 974 | } |
| 975 | return a / n; |
| 976 | } |
| 977 | |
| 978 | DDir perpendicular(const DDir& a) { |
| 979 | return DDir(-a.y(), a.x()); |
no outgoing calls
no test coverage detected