function triangle_k_test ( )

%*****************************************************************************80
%
%% triangle_k_test() tests triangle_k().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    16 March 2021
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'triangle_k_test():\n' );
  fprintf ( 1, '  triangle_k() indexes the nodes forming\n' );
  fprintf ( 1, '  the 30-60-90 triangles of an Eternity object.\n' );
%
%  hexagon.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  hexagon:\n' );
  fprintf ( 1, '\n' );

  [ w, p_ij ] = hexagon_word ( );

  [ t2k, tt, w_ij ] = triangle_k ( w, p_ij );

  [ m, n ] = size ( t2k );

  fprintf ( 1, '\n' );
  fprintf ( 1, '    #:  Type     30   60   90\n' );
  fprintf ( 1, '\n' );
  for i = 1 : m
    fprintf ( 1, '  %3d:    %2d', i, tt(i) );
    for j = 1 : n
      fprintf ( 1, '  %3d', t2k(i,j) );
    end
    fprintf ( 1, '\n' );
  end
%
%  tile001
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  tile001:\n' );
  fprintf ( 1, '\n' );

  k = 1;
  [ w, p_ij ] = tile_word ( k );

  [ t2k, tt, w_ij ] = triangle_k ( w, p_ij );

  [ m, n ] = size ( t2k );

  fprintf ( 1, '\n' );
  fprintf ( 1, '    #:  Type     30   60   90\n' );
  fprintf ( 1, '\n' );
  for i = 1 : m
    fprintf ( 1, '  %3d:    %2d', i, tt(i) );
    for j = 1 : n
      fprintf ( 1, '  %3d', t2k(i,j) );
    end
    fprintf ( 1, '\n' );
  end
%
%  trinity.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  trinity:\n' );
  fprintf ( 1, '\n' );

  [ w, p_ij ] = trinity_word ( );

  [ t2k, tt, w_ij ] = triangle_k ( w, p_ij );

  [ m, n ] = size ( t2k );

  fprintf ( 1, '\n' );
  fprintf ( 1, '    #:  Type     30   60   90\n' );
  fprintf ( 1, '\n' );
  for i = 1 : m
    fprintf ( 1, '  %3d:    %2d', i, tt(i) );
    for j = 1 : n
      fprintf ( 1, '  %3d', t2k(i,j) );
    end
    fprintf ( 1, '\n' );
  end

  return
end

