function rot_test ( )

%*****************************************************************************80
%
%% rot_test() tests rot().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    02 January 2016
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'rot_test():\n' );
  fprintf ( 1, '  rot() rotates and flips a quadrant appropriately.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '   X   Y  X0  Y0  X1  Y1\n' );
  fprintf ( 1, '\n' );

  m = 3;
  n = 2 ^ m;
  ry = 0;

  for y = 0 : 7
    for x = 0 : 7
      rx = 0;
      x0 = x;
      y0 = y;
      [ x0, y0 ] = rot ( n, x0, y0, rx, ry );
      rx = 1;
      x1 = x;
      y1 = y;
      [ x1, y1 ] = rot ( n, x1, y1, rx, ry );
      fprintf ( 1, '  %2d  %2d  %2d  %2d  %2d  %2d\n', x, y, x0, y0, x1, y1 );
    end
  end

  return
end
