function triangle_reflect_test ( )

%*****************************************************************************80
%
%% triangle_reflect_test tests triangle_reflect().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    16 November 2020
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'triangle_reflect_test\n' );
  fprintf ( 1, '  triangle_reflect() reflects a polyiamond\n' );
  fprintf ( 1, '  that is described by a triangle list.\n' );

  t0 = triangle_gort ( );
  r = 1;
  t1 = triangle_reflect ( t0, r );
  r = 2;
  t2 = triangle_reflect ( t0, r );
  r = 3;
  t3 = triangle_reflect ( t0, r );
%
%  Get the plot range.
%
  [ imin0, imax0, jmin0, jmax0 ] = triangle_range ( t0 );
  [ imin1, imax1, jmin1, jmax1 ] = triangle_range ( t1 );
  [ imin2, imax2, jmin2, jmax2 ] = triangle_range ( t2 );
  [ imin3, imax3, jmin3, jmax3 ] = triangle_range ( t3 );

  imin = min ( [ 0, imin0, imin1, imin2, imin3 ] );
  imax = max ( [ 0, imax0, imax1, imax2, imax3 ] ) + 1;
  jmin = min ( [ 0, jmin0, jmin1, jmin2, jmin3 ] );
  jmax = max ( [ 0, jmax0, jmax1, jmax2, jmax3 ] ) + 1;
%
%  Draw the grid.
%
  clf ( );
  hold ( 'on' );
  r = 0.85;
  color_back = 'cyan';
  color_tri =  'white';
  number = false;
  grid_plot ( imin, imax, jmin, jmax, r, color_back, color_tri, number );
%
%  Draw the polyiamonds.
%
  color = 'cyan';
  number = true;
  triangle_plot ( t0, color, number );

  color = 'magenta';
  number = true;
  triangle_plot ( t1, color, number );

  color = 'yellow';
  number = true;
  triangle_plot ( t2, color, number );

  color = 'blue';
  number = true;
  triangle_plot ( t3, color, number );

  axis ( 'equal' );
  axis ( 'off' );
  title ( 'triangle reflect _test' )
  hold ( 'off' );

  filename = 'triangle_reflect_test.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'triangle_reflect\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end

