function xy_to_ij_test ( )

%*****************************************************************************80
%
%% xy_to_ij_test() tests xy_to_ij().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    03 November 2020
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'xy_to_ij_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  xy_to_ij converts a point''s (x,y) coordinates to (i,j).\n' );
%
%  Check the 4x5 parallelogram
%
  c = cos ( pi / 3.0 );
  s = sin ( pi / 3.0 );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  (X,Y)    (I,J)\n' );
  for jj = 0 : 4
    fprintf ( 1, '\n' );
    for ii = 0 : 5
      x = ii + jj * c;
      y = jj * s;
      [ i, j ] = xy_to_ij ( x, y );
      fprintf ( 1, '  (%f,%f)   (%f,%f)\n', x, y, i, j );
    end
  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'xy_to_ij_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end
