Go to the documentation of this file.
36 #define LARGE_DISTANCE 100000
37 #define MIN_BLOB_SIZE 10
38 #define MAX_ASPECT_RATIO 2.5
49 #define same_point(p1,p2) \
50 ((abs (p1.x - p2.x) < chop_same_distance) && \
51 (abs (p1.y - p2.y) < chop_same_distance))
60 #define dist_square(p1,p2) \
61 ((p2.x - p1.x) * (p2.x - p1.x) + \
62 (p2.y - p1.y) * (p2.y - p1.y))
71 #define closest(test_p,p1,p2) \
74 ((dist_square (test_p->pos, p1->pos) < \
75 dist_square (test_p->pos, p2->pos)) ? \
87 #define edgept_dist(p1,p2) \
88 (dist_square ((p1)->pos, (p2)->pos))
97 #define is_exterior_point(edge,point) \
98 (same_point (edge->prev->pos, point->pos) || \
99 same_point (edge->next->pos, point->pos) || \
100 (angle_change (edge->prev, edge, edge->next) - \
101 angle_change (edge->prev, edge, point) > 20))
109 #define is_equal(p1,p2) \
110 (((p1).x == (p2).x) && ((p1).y == (p2).y))
120 #define is_on_line(p,p0,p1) \
121 (within_range ((p).x, (p0).x, (p1).x) && \
122 within_range ((p).y, (p0).y, (p1).y))
131 #define within_range(x,x0,x1) \
132 (((x0 <= x) && (x <= x1)) || ((x1 <= x) && (x <= x0)))