Tesseract
3.02
|
Go to the source code of this file.
Defines | |
#define | point_diff(p, p1, p2) |
#define | CROSS(a, b) ((a).x * (b).y - (a).y * (b).x) |
#define | SCALAR(a, b) ((a).x * (b).x + (a).y * (b).y) |
#define | LENGTH(a) ((a).x * (a).x + (a).y * (a).y) |
Functions | |
int | direction (EDGEPT *point) |
#define CROSS | ( | a, | |
b | |||
) | ((a).x * (b).y - (a).y * (b).x) |
Definition at line 54 of file vecfuncs.h.
#define LENGTH | ( | a | ) | ((a).x * (a).x + (a).y * (a).y) |
Definition at line 72 of file vecfuncs.h.
#define point_diff | ( | p, | |
p1, | |||
p2 | |||
) |
((p).x = (p1).x - (p2).x, \ (p).y = (p1).y - (p2).y, \ (p))
Definition at line 43 of file vecfuncs.h.
#define SCALAR | ( | a, | |
b | |||
) | ((a).x * (b).x + (a).y * (b).y) |
Definition at line 63 of file vecfuncs.h.
int direction | ( | EDGEPT * | point | ) |
direction to return
prev point
next point
Definition at line 43 of file vecfuncs.cpp.
{ int dir; EDGEPT *prev; EDGEPT *next; dir = 0; prev = point->prev; next = point->next; if (((prev->pos.x <= point->pos.x) && (point->pos.x < next->pos.x)) || ((prev->pos.x < point->pos.x) && (point->pos.x <= next->pos.x))) dir = 1; if (((prev->pos.x >= point->pos.x) && (point->pos.x > next->pos.x)) || ((prev->pos.x > point->pos.x) && (point->pos.x >= next->pos.x))) dir = -1; return dir; }