function b = evo2(A); %Function returns the threshold point for split

Z=A(:,1)+i*A(:,2);

X=real(Z);
Y=imag(Z);

X1=real(Z);    
Y1=imag(Z);

%figure;

xmax=max(X)+0.1*max(X);
xmin=min(X)-0.1*min(X);
ymax=max(Y)+0.1*max(Y);
ymin=min(Y)-0.1*min(Y); %Size of Axis
axis([xmin xmax ymin ymax])
hold on;

n=length(X1);

plot(X1,Y1);%erster Plot
pointsleft=15;

Zneu=Z;
for i1=1:n-pointsleft
Winkelmaass=Winkel(Zneu);%Function: computes a relvance measure for every point"
[y,I]=sort(Winkelmaass);
Zneu(I(1))=[];
%in Zneu the points with the smallest relevance measure is removed
end

axis([xmin xmax ymin ymax])
     hold on;
     plot(real(Zneu), imag(Zneu),'r');
     title(['Original Points: ', num2str(n),'   Evolved Points: ', num2str(pointsleft)])

hold off;

r = real(Zneu);
i = imag(Zneu);


% i(1,:) = []; r(1,:) = [];
% i(14,:) = []; r(14,:) = [];

itemp = i;
rtemp = r;

j = 1;
for k = 1:8
[minimum , index] =  min(i);

temp = r(index,:);
col = find(rtemp == temp);

if (size(itemp,1) >= col+1) & ((col-1) ~= 0) 
if (itemp(col-1,:) > i(index,:)) & (itemp(col+1,:) > i(index,:))
answer(j) = r(index,:);
j = j + 1;
end
end

i(index,:) = []; r(index,:) = [];
end

b = answer;


return

