function [Z]=makedomain(n);
// prepares a DEM of a special kind

for i=1:1:n
 for j=1:1:n 
  x=i/n; y=j/n;
  diff=1-(x+0.2)^2-(y+0.1)^2; // inside or outside?
  if diff<0
   slop=1/2; // different slopes inside 
  else
   slop=2; //and outside 
  end;
  Z(i,j)=slop*abs(diff)+1/(99+abs(diff))*rand(1,1)+0.9*y;
  // decrease 99 to increase the randomization
 end;
end;

endfunction;

