| 992 | } |
| 993 | |
| 994 | double point_line_distance(const DPoint& p, const DPoint& line_point, const DDir& line_dir) { |
| 995 | auto u = unit(line_dir); |
| 996 | auto delta = (p - line_point); |
| 997 | if (u.squared_length() < 1.e-18) { |
| 998 | return std::sqrt(delta.squared_length()); |
| 999 | } |
| 1000 | return std::abs(CGAL::determinant(u.x(), u.y(), delta.x(), delta.y())); |
| 1001 | } |
| 1002 | |
| 1003 | double angle_between_dirs_deg(const DDir& a, const DDir& b) { |
| 1004 | auto u = unit(a); |
no test coverage detected