function xy_new = chirikov_map ( xy )

%*****************************************************************************80
%
%% chirikov_map() applies the Chirikov map to data.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    10 January 2022
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real xy(2): the current data.
%
%  Output:
%
%    real xy_new(2): the data after mapping.
%
  x = xy(1);
  y = xy(2);

  [ k, n, xy0 ] = chirikov_parameters ( ); 

  y_new = y + k * sin ( x );
  x_new = x + y_new;

  y_new = mod ( y_new, 2.0 * pi );
  x_new = mod ( x_new, 2.0 * pi );

  xy_new = [ x_new, y_new ];

  return
end

