9 #define COLLINEAR_THRESHOLD 0.0 64 return((*
f)( p1, p2));
69 printf(
"Point (%f, %f)\n", point->
x, point->
y);
81 #ifdef DEBUG_CHECK_TURN 82 printf(
"Area %f. P (%lf,%lf). Q (%lf,%lf). R (%lf,%lf)\n", area, p1->
x, p1->
y, p2->
x, p2->
y, p3->
x, p3->
y);
88 #ifdef DEBUG_CHECK_TURN 96 #ifdef DEBUG_CHECK_TURN 104 #ifdef DEBUG_CHECK_TURN 105 printf(
"COLLINEAR\n");
121 temp[0] = (p1->
x - q->
x);
122 temp[1] = (p1->
y - q->
y);
123 temp[2] = (
POINT_T) (pow((p1->
x - q->
x), 2) + pow((p1->
y - q->
y), 2));
126 temp[3] = (p2->
x - q->
x);
127 temp[4] = (p2->
y - q->
y);
128 temp[5] = (
POINT_T) (pow((p2->
x - q->
x), 2) + pow((p2->
y - q->
y), 2));
131 temp[6] = (p3->
x - q->
x);
132 temp[7] = (p3->
y - q->
y);
133 temp[8] = (
POINT_T) (pow((p3->
x - q->
x), 2) + pow((p3->
y - q->
y), 2));
136 value = (temp[0]*temp[4]*temp[8]) +
137 (temp[1]*temp[5]*temp[6]) +
138 (temp[2]*temp[3]*temp[7]) -
139 (temp[2]*temp[4]*temp[6]) -
140 (temp[5]*temp[7]*temp[0]) -
141 (temp[8]*temp[1]*temp[3]);
154 bool is_In_Triangle=
false;
161 is_In_Triangle =
true;
165 is_In_Triangle =
false;
168 return(is_In_Triangle);
174 int has_Extreme=
FALSE;
188 return(p1->
x < p2->
x);
194 return(p1->
x > p2->
x);
200 return(p1->
y > p2->
y);
223 if ((p1->
y == p2->
y) &&
261 dist =
sqrt(pow( p->
x - q->
x, 2) + pow( p->
y - q->
y, 2));
271 area = (- (double) p2->
x*p1->
y + (
double) p3->
x*p1->
y + (double) p1->
x*p2->
y -
272 (
double) p3->
x*p2->
y - (double) p1->
x*p3->
y + (
double) p2->
x*p3->
y);
#define COLLINEAR_THRESHOLD
void sqrt(Image< double > &op)
int lexicographic_Higher(struct Point_T *p1, struct Point_T *p2)
void print_Point(struct Point_T *point)
int equal_Point(struct Point_T *p1, struct Point_T *p2)
int higher_Point(struct Point_T *p1, struct Point_T *p2, int(*f)(struct Point_T *, struct Point_T *))
int in_Circle(struct Point_T *p1, struct Point_T *p2, struct Point_T *p3, struct Point_T *q)
TYPE Euclidean(struct Point_T *p, struct Point_T *q)
int higher_Y(struct Point_T *p1, struct Point_T *p2)
bool interior_Triangle(struct Point_T *p1, struct Point_T *p2, struct Point_T *p3, struct Point_T *q)
TYPE distance(struct Point_T *p, struct Point_T *q)
TYPE signed_Area(struct Point_T *p1, struct Point_T *p2, struct Point_T *p3)
enum Turn_T check_Turn(struct Point_T *p1, struct Point_T *p2, struct Point_T *p3)
int lower_X(struct Point_T *p1, struct Point_T *p2)
int higher_X(struct Point_T *p1, struct Point_T *p2)
void copy_Point(struct Point_T *p1, struct Point_T *p2)
int has_Extreme_Coordinates(struct Point_T *p)