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

%*****************************************************************************80
%
%% annulus_grid_fibonacci() computes Fibonacci grid points inside a annulus.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    11 November 2022
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Richard Swinbank, James Purser,
%    Fibonacci grids: A novel approach to global modelling,
%    Quarterly Journal of the Royal Meteorological Society,
%    Volume 132, Number 619, July 2006 Part B, pages 1769-1793.
%
%  Input:
%
%    integer N, the number of points desired.
%
%    real R1, R2, the inner and outer radius of the annulus.
%
%    real C(2), the coordinates of the center of the annulus.
%
%  Output:
%
%    real G(N,2), the grid points.
%
  phi = ( 1.0 + sqrt ( 5.0 ) ) / 2.0;

  m = 0.5 + ( n - 0.5 ) * r1^2 / ( r2^2 - r1^2 );
  i = m + 1 : m + n;

  gr = r2 * sqrt ( i - 0.5 ) / sqrt ( m + n - 0.5 );
  gt = 2.0 * pi * i / phi;

  g = zeros ( n, 2 );

  g(1:n,1) = c(1) + gr .* cos ( gt );
  g(1:n,2) = c(2) + gr .* sin ( gt );

  return
end
