function adjacency_to_triangle_ij_test ( )

%*****************************************************************************80
%
%% adjacency_to_triangle_ij_test() tests adjacency_to_triangle_ij().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    27 January 2021
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'adjacency_to_triangle_ij_test():\n' );
  fprintf ( 1, '  adjacency_to_triangle_ij() takes a list of adjacent 30-60-90\n' );
  fprintf ( 1, '  triangles, and returns a list of (i,j) vertex coordinates.\n' );

  [ ta, t1_ij ] = tile001_adjacency ( );
  tn = size ( ta, 1 );

  [ a_ij, b_ij, c_ij ] = adjacency_to_triangle_ij ( ta, t1_ij );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  #k  (ai,aj)  (bi,bi)  (cx,cy)\n' );
  fprintf ( 1, '\n' );
  for tk = 1 : tn
    fprintf ( 1, '%2d: (%d,%d), (%d,%d), (%d,%d)\n', ...
      tk, a_ij(tk,1:2), b_ij(tk,1:2), c_ij(tk,1:2) );
  end
%
%  Plot the vertices.
%
  figure ( );
  clf ( );
  hold ( 'on' );
  plot ( a_ij(1:tn,1), a_ij(1:tn,2), 'r.', 'markersize', 20 );
  plot ( b_ij(1:tn,1), b_ij(1:tn,2), 'g.', 'markersize', 20 );
  plot ( c_ij(1:tn,1), c_ij(1:tn,2), 'b.', 'markersize', 20 );
  hold ( 'off' );
  grid ( 'on' );
  xlabel ( '<-- I -->' );
  ylabel ( '<-- J -->' );
  title ( {'adjacency\_to\_triangle\_ij: tile001', 'red=30, green=60, blue=90'} );
  axis ( 'equal' );
  filename = 'tile001_triangle_ij.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  fprintf ( 1, '\n' );
  fprintf ( 1, 'adjacency_to_triangle_ij_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end

