Go to the source code of this file.
|
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 | lower_X (struct Point_T *p1, struct Point_T *p2) |
|
int | higher_X (struct Point_T *p1, struct Point_T *p2) |
|
int | higher_Y (struct Point_T *p1, struct Point_T *p2) |
|
int | lexicographic_Higher (struct Point_T *p1, struct Point_T *p2) |
|
void | copy_Point (struct Point_T *p1, struct Point_T *p2) |
|
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 | in_Circle (struct Point_T *p1, struct Point_T *p2, struct Point_T *p3, struct Point_T *q) |
|
bool | interior_Triangle (struct Point_T *p1, struct Point_T *p2, struct Point_T *p3, struct Point_T *q) |
|
int | has_Extreme_Coordinates (struct Point_T *p) |
|
void | print_Point (struct Point_T *point) |
|
◆ Turn_T
Enumerator |
---|
COLINEAR | |
LEFT_TURN | |
RIGHT_TURN | |
Definition at line 10 of file point.h.
◆ check_Turn()
Definition at line 73 of file point.cpp.
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");
#define COLLINEAR_THRESHOLD
TYPE signed_Area(struct Point_T *p1, struct Point_T *p2, struct Point_T *p3)
◆ copy_Point()
◆ distance()
Definition at line 28 of file point.cpp.
TYPE Euclidean(struct Point_T *p, struct Point_T *q)
◆ equal_Point()
◆ has_Extreme_Coordinates()
int has_Extreme_Coordinates |
( |
struct Point_T * |
p | ) |
|
◆ higher_Point()
Definition at line 62 of file point.cpp.
64 return((*
f)( p1, p2));
◆ higher_X()
◆ higher_Y()
◆ in_Circle()
Definition at line 114 of file point.cpp.
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]);
◆ interior_Triangle()
Definition at line 152 of file point.cpp.
154 bool is_In_Triangle=
false;
161 is_In_Triangle =
true;
165 is_In_Triangle =
false;
168 return(is_In_Triangle);
TYPE signed_Area(struct Point_T *p1, struct Point_T *p2, struct Point_T *p3)
◆ lexicographic_Higher()
◆ lower_X()
◆ print_Point()
void print_Point |
( |
struct Point_T * |
point | ) |
|
Definition at line 67 of file point.cpp.
69 printf(
"Point (%f, %f)\n", point->
x, point->
y);
◆ signed_Area()
Definition at line 267 of file point.cpp.
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);