function [n1,n2,xf,yf,xg,yg,xh,yh] = partition(xi,eta,XY,N)
% PARTITION  Partitions the data  XY in three data sets
%            [n1,n2,xf,yf,xg,yg,xh,yh] = PARTITION(xi,eta,XY,N)

n1 = sum(XY(:,1)<xi);   n2 = sum(XY(:,1)<eta);
xf = XY(1:n1,1); yf = XY(1:n1,2);
xg = XY(n1+1:n2,1); yg = XY(n1+1:n2,2);
xh = XY(n2+1:N,1); yh = XY(n2+1:N,2);

