7 double pgon[50000][2] ;
11 int inside_flag, xflag0 ;
22 p = (
double *)
pgon + 1 ;
23 if ( ( y >= ty ) != ( *p >= ty ) ) {
26 ( *(
double *)
pgon >= tx ) ) {
28 if ( xflag0 ) crossings++ ;
40 for ( y=*p,p += 2 ; p < stop ; y=*p,p+=2) {
43 while ( (p < stop) && (*p >= ty) ) p+=2 ;
44 if ( p >= stop )
goto Exit ;
46 if ( ( xflag0 = ( *(p-3) >= tx ) ) ==
49 if ( xflag0 ) crossings++ ;
54 crossings += ( *(p-3) -
55 (*(p-2)-ty)*( *(p-1)-*(p-3))/(*p-*(p-2))) >= tx ;
58 while ( (p < stop) && (*p < ty)) p+=2 ;
59 if ( p >= stop )
goto Exit ;
61 if ( ( xflag0 = ( *(p-3) >= tx ) ) ==
64 if ( xflag0 ) crossings++ ;
69 crossings += ( *(p-3) -
70 (*(p-2)-ty)*( *(p-1)-*(p-3))/(*p-*(p-2))) >= tx ;
80 inside_flag = crossings & 0x01 ;
82 return (inside_flag) ;
int macmartintest(pgon, numverts, point)