package face8;
public class polygon {
int x=new int[500];
int y=new int[500];
int xx=new int[500];
int yy=new int[500];
int number,ax,ay;
int vx1,vx2,vy1,vy2;
int x2,y2;
int s;
int sig,sp;
int ch,check;
int makedata(int x1,int y1){
check=0;
avg();
for(s=1;s<number+1;s++){
xx[s]=x[s]-ax;
yy[s]=y[s]-ay;
}
x2=x1-ax;
y2=y1-ay;
for(sig=1;sig<number+1;sig++){
vx1=xx[sig];
vy1=yy[sig];
sp=sig+1;
if(sp>number)sp=1;
vx2=xx[sp];
vy2=yy[sp];
triangle sub=new triangle();
sub.vx1=vx1;
sub.vx2=vx2;
sub.vy1=vy1;
sub.vy2=vy2;
ch=sub.makedata(x2,y2);
if(ch>50)check=100;
}
return check;
}
void avg(){
int s,x1,y1;
x1=0;
for(s=1;s<number+1;s++){
x1=x1+x[s];
}
ax=x1/number;
y1=0;
for(s=1;s<number+1;s++){
y1=y1+y[s];
}
ay=y1/number;
}
}