Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int pnpoly(int nvert, float *vertx, float *verty, float testx, float testy)
- {
- int i, j, c = 0;
- for (i = 0, j = nvert-1; i < nvert; j = i++) {
- if ( ((verty[i]>testy) != (verty[j]>testy)) &&
- (testx < (vertx[j]-vertx[i]) * (testy-verty[i]) / (verty[j]-verty[i]) + vertx[i]) )
- c = !c;
- }
- return c;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement