function [ z, seed ] = c8_normal_01 ( seed )

%*****************************************************************************80
%
%% C8_NORMAL_01 returns a unit normally distributed complex number.
%
%  Discussion:
%
%    The value has mean 0 and standard deviation 1.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    17 July 2006
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer SEED, a seed for the random number generator.
%
%  Output:
%
%    complex Z, a sample of the PDF.
%
%    integer SEED, a seed for the random number generator.
%
  v1 = rand ( 1, 1 );
  v2 = rand ( 1, 1 );

  x_r = sqrt ( - 2.0 * log ( v1 ) ) * cos ( 2.0 * pi * v2 );
  x_c = sqrt ( - 2.0 * log ( v1 ) ) * sin ( 2.0 * pi * v2 );

  z = x_r + x_c * i;

  return
end
