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

Function unit

src/svgfill/src/arrange_polygons.cpp:970–976  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

968};
969
970DDir 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
978DDir perpendicular(const DDir& a) {
979 return DDir(-a.y(), a.x());

Callers 8

point_line_distanceFunction · 0.70
angle_between_dirs_degFunction · 0.70
rectangle_cornersFunction · 0.70
runs_from_graphFunction · 0.70
build_run_box_recordsFunction · 0.70
merge_cluster_to_boxFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected