function [ x, seed ] = normal_samples ( n, mu, sigma, seed )

%*****************************************************************************80
%
%% NORMAL_SAMPLES samples the Normal PDF.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    26 September 2018
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer N, the number of samples.
%
%    Input, real MU, SIGMA, the parameters of the PDF.
%    SIGMA nonzero.
%
%    Input, integer SEED, a seed for the random number generator.
%
%    Output, real X(N), samples of the PDF.
%
%    Output, integer SEED, an updated seed for the random number generator.
%
  [ r, seed ] = r8mat_uniform_01 ( n, 2, seed );

  x(1:n,1) = mu + sigma * sqrt ( -2.0 * log ( r(1:n,1) ) ) ...
    .* cos ( 2.0 * pi * r(1:n,2) );

  return
end
