MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / isPointOnSegment

Function isPointOnSegment

src/util/util.cpp:183–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183bool isPointOnSegment(const MapCoordF& seg_start, const MapCoordF& seg_end, const MapCoordF& point)
184{
185 bool ok;
186 double param = parameterOfPointOnLine(seg_start.x(), seg_start.y(),
187 seg_end.x() - seg_start.x(), seg_end.y() - seg_start.y(),
188 point.x(), point.y(), ok);
189 return ok && param >= 0 && param <= 1;
190}
191
192
193void Util::hatchingOperation(const QRectF& extent, double spacing, double offset, double rotation,

Callers 1

Calls 3

parameterOfPointOnLineFunction · 0.85
xMethod · 0.80
yMethod · 0.80

Tested by

no test coverage detected