MCPcopy Create free account
hub / github.com/MapServer/MapServer / point_in_triangle

Function point_in_triangle

renderers/agg/include/agg_math.h:45–54  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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