** Copyright (c) 1970-2003, Wm. Randolph Franklin ** ** Permission is hereby granted, free of charge, to any person obtaining a copy of this software and ** associated documentation
| 158 | ** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 159 | */ |
| 160 | int msPointInPolygon(pointObj *p, lineObj *c) |
| 161 | { |
| 162 | int i, j, status = MS_FALSE; |
| 163 | |
| 164 | for (i = 0, j = c->numpoints-1; i < c->numpoints; j = i++) { |
| 165 | if ((((c->point[i].y<=p->y) && (p->y<c->point[j].y)) || ((c->point[j].y<=p->y) && (p->y<c->point[i].y))) && (p->x < (c->point[j].x - c->point[i].x) * (p->y - c->point[i].y) / (c->point[j].y - c->point[i].y) + c->point[i].x)) |
| 166 | status = !status; |
| 167 | } |
| 168 | return status; |
| 169 | } |
| 170 | |
| 171 | /* |
| 172 | ** Note: the following functions are brute force implementations. Some fancy |
no outgoing calls
no test coverage detected