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

Function IsPointStrictlyInsideTriangle

libs/geometry/triangle2d.cpp:29–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29bool IsPointStrictlyInsideTriangle(PointD const & pt, PointD const & p1, PointD const & p2, PointD const & p3)
30{
31 double const s1 = robust::OrientedS(p1, p2, pt);
32 double const s2 = robust::OrientedS(p2, p3, pt);
33 double const s3 = robust::OrientedS(p3, p1, pt);
34
35 return ((s1 > 0.0 && s2 > 0.0 && s3 > 0.0) || (s1 < 0.0 && s2 < 0.0 && s3 < 0.0));
36}
37
38bool IsPointInsideTriangles(PointD const & pt, std::vector<TriangleD> const & v)
39{

Callers 2

UNIT_TESTFunction · 0.85

Calls 1

OrientedSFunction · 0.85

Tested by 1

UNIT_TESTFunction · 0.68