I just got back to this problem now. Yes, changing it to a while loop fixed the little bug and cleans things up in the translation for sure. Thanks for the tip.
> On Oct 24, 2016, at 3:20 AM, Bernd Oppolzer <bernd.oppol...@t-online.de> > wrote: > > int pnpoly (int nvert, float *vertx, float *verty, float testx, float testy) > { > int i, j, c = 0; > > i = 0, j = nvert-1; > > while (i < nvert) > { > if (((verty [i] > testy) != (verty [j] > testy)) && > (testx < (vertx[j] - vertx[i]) * (testy - verty [i]) > / (verty [j] - verty [i]) + vertx [i])) > c = !c; > > j = i; > i = i + 1; > } > > return c; > } Regards, Ryan Joseph _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal