58 int64_t winding_number = 0;
61 if (theta != 0 && center) {
62 double x1, y1, ct, st;
68 x1 = x0 * ct - y0 * st + center[0];
69 y1 = x0 * st + y0 * ct + center[1];
74 for (i1 = 0; i1 < n; i1++) {
86 printf(
"upward crossing\n");
89 if (pointIsLeftOfLine(i1, i2, x, y, x0, y0) > 0) {
99 printf(
"downward crossing\n");
102 if (pointIsLeftOfLine(i1, i2, x, y, x0, y0) < 0) {
109 printf(
"i1 = %" PRId64
", winding_number = %" PRId64
"\n", i1, winding_number);
115 printf(
"winding_number = %" PRId64
"\n", winding_number);
119 return (winding_number != 0);
int pointIsInsideContour(double x0, double y0, double *x, double *y, int64_t n, double *center, double theta)
Determine if a given point (x0, y0) is inside a specified polygonal contour.