function index=find_in_hyperstate5(state,hyperstate)

index=1;
len=(state(1,1,1)-hyperstate(1,1,1))^2+(state(1,2)-hyperstate(1,1,2))^2+(state(1,1,3)-hyperstate(1,1,3))^2;

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