function out=octave_mandelbrot()
    m = 20;
    n = m;
    count_max = 20;
%
%  The whole thing.
%
 x_min = - 2.25;
 x_max =   1.25;
 y_min = - 1.75;
 y_max =   1.75;
%
%  Extreme close up of the lower "neck".
%
% x_min = - 0.76;
% x_max = - 0.74;
% y_min = - 0.05;
% y_max = - 0.03;
%
%  Closeup of the upper neck.
%
#  x_min = - 1.00;
#  x_max = - 0.60;
#  y_min =   0.00;
#  y_max =   0.40;

  I = ( 1 : m );
  J = ( 1 : n );
  X = ( ( I - 1 ) * x_max + ( m - I ) * x_min ) / ( m - 1 );
  Y = ( ( J - 1 ) * y_max + ( n - J ) * y_min ) / ( n - 1 );
  [ Zr, Zi ] = meshgrid ( X, Y );
  C = complex ( Zr, Zi );

  Z = C;
  ieps = 1 : numel ( C );
  d(ieps) = count_max + 1;

  for i = 1 : count_max
    Z(ieps) = Z(ieps) .* Z(ieps) + C(ieps);
    U(ieps) = abs ( Z(ieps) );
    neps = ieps ( find ( 2.0 < U(ieps) ) );
    d(neps) = i;
    ieps = ieps ( find ( U(ieps) <= 2.0 ) );
  end

  clf ( );
  t = delaunay ( Zr, Zi );
  colormap ( 'prism');
  h = trisurf ( t, Zr, Zi, d );
 out = "";
endfunction
