function ind=inside2(x,y);
%function ind=inside2(x,y);
[xa,ya]=draw;
hold on
n=length(xa)+1;
xa(n)=xa(1);
ya(n)=ya(1);
plot(xa,ya,'c5');
dx=diff(xa);
dy=diff(ya);
ind=ones(x);
for i=1:(n-1)
   hyp=sqrt(dx(i)^2+dy(i)^2);
   costheta=dx(i)/hyp;
   sintheta=dy(i)/hyp;
   ind=ind&(-(x-xa(i))*sintheta+(y-ya(i))*costheta<=0);
%  (-(x-xa(i))*sintheta+(y-ya(i))*costheta<=0);
%keyboard
end
ind=find(ind);
plot(x(ind),y(ind),'*w')
