function THETA=selection(distance)

global Dtheta;

THETA = Dtheta(1)*pi/180;
    if distance>=400000 && distance<=800000  
        THETA = Dtheta(2)*pi/180;
    elseif distance>=800000 && distance<=1200000  
        THETA = Dtheta(3)*pi/180;
    elseif distance>=1200000 && distance<=1600000  
       THETA = Dtheta(4)*pi/180;
    elseif distance>=1600000 && distance<=2000000 
       THETA = Dtheta(5)*pi/180;
    elseif distance>=2000000 && distance<=2400000 
       THETA = Dtheta(6)*pi/180;
    elseif distance>=2400000 && distance<=2800000 
       THETA = Dtheta(7)*pi/180;
    elseif distance>=2800000 && distance<=3200000 
       THETA = Dtheta(8)*pi/180;
    elseif distance>=3200000 && distance<=3600000 
       THETA = Dtheta(9)*pi/180;
    elseif distance>=3600000 && distance<=4000000 
       THETA = Dtheta(10)*pi/180;
    end
end






