function adjacency_to_triangle_xy_test ( )

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

  [ ta, t1_ij ] = tile001_adjacency ( );

  p_xy = [ 0.0, 0.0 ];
  t1_xy = node_ij_to_xy ( t1_ij, p_xy );

  [ a_xy, b_xy, c_xy ] = adjacency_to_triangle_xy ( ta, t1_xy );

  tn = size ( ta, 1 );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  #i  (ax,ay)  (bx,by)  (cx,cy)\n' );
  fprintf ( 1, '\n' );
  for ti = 1 : tn
    fprintf ( 1, '%2d: (%f,%f), (%f,%f), (%f,%f)\n', ...
      ti, a_xy(ti,1:2), b_xy(ti,1:2), c_xy(ti,1:2) );
  end
%
%  Plot the vertices.
%
  figure ( );
  clf ( );
  hold ( 'on' );
  plot ( a_xy(1:tn,1), a_xy(1:tn,2), 'r.', 'markersize', 20 );
  plot ( b_xy(1:tn,1), b_xy(1:tn,2), 'g.', 'markersize', 20 );
  plot ( c_xy(1:tn,1), c_xy(1:tn,2), 'b.', 'markersize', 20 );
  hold ( 'off' );
  grid ( 'on' );
  xlabel ( '<-- X -->' );
  ylabel ( '<-- Y -->' );
  title ( {'adjacency\_to\_triangle\_xy: tile001', 'red=30, green=60, blue=90'} );
  axis ( 'equal' );
  filename = 'tile001_triangle_xy.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

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

  return
end

