MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / point_in_triangle

Function point_in_triangle

dep/agg/include/agg_math.h:44–57  ·  view source on GitHub ↗

--------------------------------------------------------point_in_triangle

Source from the content-addressed store, hash-verified

42
43 //--------------------------------------------------------point_in_triangle
44 AGG_INLINE bool point_in_triangle(double x1,
45 double y1,
46 double x2,
47 double y2,
48 double x3,
49 double y3,
50 double x,
51 double y)
52 {
53 bool cp1 = cross_product(x1, y1, x2, y2, x, y) < 0.0;
54 bool cp2 = cross_product(x2, y2, x3, y3, x, y) < 0.0;
55 bool cp3 = cross_product(x3, y3, x1, y1, x, y) < 0.0;
56 return cp1 == cp2 && cp2 == cp3 && cp3 == cp1;
57 }
58
59 //-----------------------------------------------------------calc_distance
60 AGG_INLINE double calc_distance(double x1, double y1, double x2, double y2)

Callers

nothing calls this directly

Calls 1

cross_productFunction · 0.85

Tested by

no test coverage detected