function [z, a, b, alpha] = gen_initdata (X, how_init);
%GEN_INITDATA
%
%       [z, a, b, alpha] = gen_initdata (X, how_init);
%       generate initial data for ellipse fit.
%
  if     (strcmp(how_init, 'algcircle')),
    [z, a] = algcircle (X);
    a = abs(a);
    b = a;
    alpha = 0;
  elseif (strcmp(how_init, 'bookstein')),
    [z, a, b, alpha] = bookstein_svd (X);
  else
    str = sprintf ('unknown method %s', how_init);
    error (str);
  end

end % gen_initdata

