function index=find_in_hyperstate5(state,hyperstate)

index=1;
len=(state(1,1)-hyperstate(1,1,1))^2+(state(1,2)-hyperstate(1,1,2))^2;
%plot(hyperstate(1,:,1),hyperstate(1,:,2),'b+'); hold on
%plot(state(1,1),state(1,2),'r.');

for i=2:size(hyperstate,2)
    pom2=(state(1,1)-hyperstate(1,i,1))^2+(state(1,2)-hyperstate(1,i,2))^2;    
    if pom2<len
        len=pom2;
        index=i;
    end
end
    
end
