function grid_polar_test ( )

%*****************************************************************************80
%
%% grid_polar_test() tests grid_polar().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    30 July 2010
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'grid_polar_test():\n' );
  fprintf ( 1, '  grid_polar() draws a polar grid.\n' );
  fprintf ( 1, '  Compare two methods of sampling the circle.\n' );

  r = sqrt ( rand ( 400, 1 ) );
  t = pi * rand ( 400, 1 );
  plot ( r .* cos ( t ), r .* sin ( t ), 'b*' );

  grid_polar ( 0.0, 0.0, 0.1, 1.0, 10, 0, 180, 13 );

  hold on

  r = - rand ( 400, 1 );
  t = pi * rand ( 400, 1 );
  plot ( r .* cos ( t ), r .* sin ( t ), 'r*' );

  grid_polar ( 0.0, 0.0, 0.1, 1.0, 10, 180, 360, 13 );

  xlabel ( 'X' )
  ylabel ( 'Y' )
  title ( 'Blue: R = sqrt(rand), Red: R = - rand' )
  axis equal
  hold off

  filename = 'grid_polar_test.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  return
end
