
function rt=lookup(prec,model,focale,distance)
  global rt;
  
  ss=model.ss;
  height=model.height;

  %% m=xx(3,:)./sqrt(xx(1,:).^2+xx(2,:).^2);
  m=1:1:distance*prec;
  m=-prec*focale./m;

  rt=[];
  poly_coef=ss(end:-1:1);
  poly_coef_tmp=poly_coef;
  
  for j=1:length(m)
    poly_coef_tmp(end-1)=poly_coef(end-1)-m(j);
    rhoTmp=roots(poly_coef_tmp);
    res=rhoTmp(find(imag(rhoTmp)==0 & rhoTmp>0 & rhoTmp<distance ));
    if isempty(res) | length(res)>1
      rt(j)=NaN;
    else
      rt(j)=res;
    end
  end
