function t_configuration_test ( )

%*****************************************************************************80
%
%% t_configuration_test() displays good and bad tile configurations.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    15 February 2022
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 't_configuration_test():\n' );
  fprintf ( 1, '  This is a simple program to illustrate how a tile\n' );
  fprintf ( 1, '  configuration can be "good" (completely inside the grid) or\n' );
  fprintf ( 1, '  "bad" (not completely inside the grid).\n' );
%
%  Plot a particular tile configuration that is NOT in the grid.
%
  color = 0;

  grid_index = 1;
  label = ''

  [ grid_w, grid_p ] = t_grid_word ( grid_index );
  figure ( );
  t_word_plot ( grid_w, grid_p );
  title ( label );

  tile_index = 3;
  [ tile_w, tile_p ] = t_tile_word ( tile_index );

  r = 0;
  [ tile_w, tile_p ] = t_rotate_word ( tile_w, tile_p, r );

  reflect = 0;
  [ tile_w, tile_p ] = t_reflect_word ( tile_w, tile_p );

  tile_p = tile_p + [ 0, 9 ];

  color = color + 1;
  t_tile_overlay_plot ( tile_w, tile_p, color );

  filename = 'configuration_bad.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Plot a particular tile configuration that IS in the grid.
%
  color = 0;

  grid_index = 1;
  label = ''

  [ grid_w, grid_p ] = t_grid_word ( grid_index );
  figure ( );
  t_word_plot ( grid_w, grid_p );
  title ( label );

  tile_index = 3;
  [ tile_w, tile_p ] = t_tile_word ( tile_index );

  r = 0;
  [ tile_w, tile_p ] = t_rotate_word ( tile_w, tile_p, r );

  reflect = 0;
  [ tile_w, tile_p ] = t_reflect_word ( tile_w, tile_p );

  tile_p = tile_p + [ 0, 12 ];

  color = color + 1;
  t_tile_overlay_plot ( tile_w, tile_p, color );

  filename = 'configuration_good.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  return
end

