function label = zcnt0(gn,fc,fr,k,lamda1,lamda2,zero_eps)
%
table1 = [3,3,4,0,5,0,4,6,6];
if gn<zero_eps
  label = 1;      % flat
else
  thetag = atan2(fc,fr); sg = sin(thetag); cg = cos(thetag);
  maxrhog = 0.5+cg*(1-cg);
  Ag = k(7)*(sg^3)+k(8)*(sg^2)*cg+k(9)*(cg^2)*sg+k(10)*(cg^3);
  Bg = k(4)*(sg^2)+k(5)*sg*cg+k(6)*(cg^2);
  if abs(Ag)<zero_eps
    zc2d = maxrhog+1.0;
  else
    zc2d = -2*Bg/(6*Ag);
  end;
  if abs(zc2d)<maxrhog
    label = 2;    % inflection point
  else
    lindex = 1+(1+sign(lamda1))*3+(1+sign(lamda2));
    label = table1(lindex);
  end;
end;
