MCPcopy Create free account
hub / github.com/comaps/comaps / IsPointOnSegment

Function IsPointOnSegment

libs/geometry/segment2d.cpp:32–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32bool IsPointOnSegment(PointD const & pt, PointD const & p1, PointD const & p2)
33{
34 // The epsilon here is chosen quite arbitrarily, to pass paranoid
35 // tests and to match our real-data geometry precision. If you have
36 // better ideas how to check whether pt belongs to (p1, p2) segment
37 // more precisely or without kEps, feel free to submit a pull
38 // request.
39 double constexpr kEps = 1e-100;
40 return IsPointOnSegmentEps(pt, p1, p2, kEps);
41}
42
43bool SegmentsIntersect(PointD const & a, PointD const & b, PointD const & c, PointD const & d)
44{

Callers 3

IsPointInsideTriangleFunction · 0.85
OnSegmentFunction · 0.85
IsFencedOffMethod · 0.85

Calls 1

IsPointOnSegmentEpsFunction · 0.85

Tested by 1

OnSegmentFunction · 0.68