MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / point_line_distance

Function point_line_distance

src/svgfill/src/arrange_polygons.cpp:994–1001  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

992}
993
994double 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
1003double angle_between_dirs_deg(const DDir& a, const DDir& b) {
1004 auto u = unit(a);

Callers 3

edge_supports_same_lineFunction · 0.85
clusters_can_mergeFunction · 0.85
snap_points_to_box_axesFunction · 0.85

Calls 1

unitFunction · 0.70

Tested by

no test coverage detected