function annulus_grid_test02 ( )

%*****************************************************************************80
%
%% annulus_grid_test02() tests annulus_grid_fibonacci().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    10 November 2022
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'annulus_grid_test02():\n' );
  fprintf ( 1, '  annulus_grid_fibonacci() defines a grid of N points\n' );
  fprintf ( 1, '  \n' );

  n = 1000;
  r1 = 1.0;
  r2 = 2.0;
  c = [ 1.0, 5.0 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, '  We use N = %d\n', n );
  fprintf ( 1, '  Inner radius R1 = %f\n', r1 );
  fprintf ( 1, '  Outer radius R2 = %f\n', r2 );
  fprintf ( 1, '  Center C = (%f,%f)\n', c(1), c(2) );

  g = annulus_grid_fibonacci ( n, r1, r2, c );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  First 20 points in grid:\n' );
  disp ( g(1:20,1:2) )

  filename = 'annulus_grid_test02.xy';

  save ( filename, 'g', '-ascii' );
  fprintf ( 1, '  Gridpoint coordinates saved as "%s".\n', filename );
%
%  Plot the points.
%
  i = 0 : 50;
  t = 2.0 * pi * i / 50.0;

  cx1 = c(1) + r1 .* cos ( t );
  cy1 = c(2) + r1 .* sin ( t );

  cx2 = c(1) + r2 .* cos ( t );
  cy2 = c(2) + r2 .* sin ( t );

  figure ( );
  clf ( );
  hold ( 'on' );
  plot ( cx1, cy1, 'r-', 'Linewidth', 3 );
  plot ( cx2, cy2, 'r-', 'Linewidth', 3 );
  plot ( g(1:n,1), g(1:n,2), 'b.' );
  hold ( 'off' );
  axis ( 'equal' );
  xlabel ( '<---X--->', 'Fontsize', 16 );
  ylabel ( '<---Y--->', 'Fontsize', 16 );
  title ( sprintf ( 'Fibonacci grid with %d points', n ), 'Fontsize', 16 );
  filename = 'annulus_grid_test02.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  return
end
