function circular_normal_sample_test ( )

%*****************************************************************************80
%
%% circular_normal_sample_test() tests circular_normal_sample().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    03 January 2012
%
%  Author:
%
%    John Burkardt
%
  sample_num = 1000;

  a = [ 1.0, 5.0 ];
  b = 0.75;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'CIRCULAR_NORMAL_SAMPLE_TEST():\n' );
  fprintf ( 1, '  CIRCULAR_NORMAL_MEAN() computes the Circular Normal mean;\n' );
  fprintf ( 1, '  CIRCULAR_NORMAL_SAMPLE() samples the Circular Normal distribution;\n' );
  fprintf ( 1, '  CIRCULAR_NORMAL_VARIANCE() computes the Circular Normal variance.\n' );

  xmean = circular_normal_mean ( a, b );
  variance = circular_normal_variance ( a, b );

  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 : sample_num
    x = circular_normal_sample ( a, b );
    x_table(i,1) = x(1);
    x_table(i,2) = x(2);
  end

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

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Sample size =     %6d\n', sample_num );
  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
