function circular_normal_01_sample_test ( )

%*****************************************************************************80
%
%% circular_normal_01_sample_test() tests circular_normal_01_sample().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    15 April 2009
%
%  Author:
%
%    John Burkardt
%
  nsample = 1000;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'CIRCULAR_NORMAL_01_SAMPLE_TEST():\n' );
  fprintf ( 1, '  CIRCULAR_NORMAL_01_MEAN() computes the Circular Normal 01 mean;\n' );
  fprintf ( 1, '  CIRCULAR_NORMAL_01_SAMPLE() samples the Circular Normal 01 distribution;\n' );
  fprintf ( 1, '  CIRCULAR_NORMAL_01_VARIANCE() computes the Circular Normal 01 variance.\n' );

  xmean = circular_normal_01_mean ( );
  variance = circular_normal_01_variance ( );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  PDF means =               %14g  %14g\n', xmean(1:2) );
  fprintf ( 1, '  PDF variances =           %14g  %14g\n', variance(1:2) );
  
  for i = 1 : nsample
    x = circular_normal_01_sample ( );
    x_table(i,1) = x(1);
    x_table(i,2) = x(2);
  end

  for j = 1 : 2
    xmean(j) = mean ( x_table(1:nsample,j) );
    variance(j) = r8vec_variance ( nsample, x_table(1:nsample,j) );
    xmax(j) = max ( x_table(1:nsample,j) );
    xmin(j) = min ( x_table(1:nsample,j) );
  end

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Sample size =     %6d\n', nsample );
  fprintf ( 1, '  Sample mean =     %14g  %14g\n', xmean(1:2) );
  fprintf ( 1, '  Sample variance = %14g  %14g\n', variance(1:2) );
  fprintf ( 1, '  Sample maximum =  %14g  %14g\n', xmax(1:2) );
  fprintf ( 1, '  Sample minimum =  %14g  %14g\n', xmin(1:2) );

  return
end
