function result = inmaze1(xy,maze,r);
% function result = inmaze1(xy,maze,r);
r1=0.8*r;
xy=xy+r1;
[n,m]=size(maze);
if all(xy>r) & all(xy<size(maze)-r),
	result = maze(ceil(xy(1)+r1),ceil(xy(2)+r1))...
	*maze(ceil(xy(1)-r1),ceil(xy(2)+r1))...
	*maze(ceil(xy(1)+r1),ceil(xy(2)-r1))...
	*maze(ceil(xy(1)-r1),ceil(xy(2)-r1));
else
    result=0;
end;
