function triangle_quadrature_symmetry_test ( )

%*****************************************************************************80
%
%% triangle_quadrature_symmetry_test() tests triangle_quadrature_symmetry().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    28 March 2023
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../triangle_quadrature_symmetry' )

  timestamp ( );

  fprintf ( 1, '\n' );
  fprintf ( 1, 'triangle_quadrature_symmetry_test():\n' );
  fprintf ( 1, '  triangle_quadrature_symmetry() tests a triangle\n' );
  fprintf ( 1, '  quadrature rule for symmetry.\n' );

  barycentric_symmetry_test ( );

  clone_count_test ( );

  unique_count_test ( );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'triangle_quadrature_symmetry_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  rmpath ( '../triangle_quadrature_symmetry' )

  return
end
function barycentric_symmetry_test ( )

%*****************************************************************************80
%
%% barycentric_symmetry_test() tests barycentric_symmetry().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    28 March 2023
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'barycentric_symmetry_test():\n' );
 
  xy = xy_quad13 ( );
  xyz = triangle_xy_to_barycentric ( xy );
  disp ( xyz );
  symmetry = barycentric_symmetry ( xyz );
  disp ( symmetry )

  return
end
function clone_count_test ( )

%*****************************************************************************80
%
%% clone_count_test() tests clone_count().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    28 March 2023
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'clone_count_test()\n' );

  xy = xy_quad13 ( );
  xyz = triangle_xy_to_barycentric ( xy );
  m = size ( xyz, 1 );
  for i = 1 : m
    clone_num = clone_count ( xyz(i,1:3), xyz );
    fprintf ( 1, '  Number of clones of %2d, %2d, %2d is %d\n', ...
      xyz(i,1:3), clone_num );
  end

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 November 2022
%
%  Author:
%
%    John Burkardt
%
  t = now ( );
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end
function unique_count_test ( )

%*****************************************************************************80
%
%% unique_count_test() tests unique_count().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    28 March 2023
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'unique_count_test():\n' );
  fprintf ( 1, '  unique_count() counts the unique items in a triplet.\n' );

  xyz = [ 1, 2, 3 ];
  unique_num = unique_count ( xyz );
  fprintf ( 1, '  Number of uniques in %2d, %2d, %2d is %d\n', xyz, unique_num );
  xyz = [ 1, 2, 1 ];
  unique_num = unique_count ( xyz );
  fprintf ( 1, '  Number of uniques in %2d, %2d, %2d is %d\n', xyz, unique_num );
  xyz = [ 2, 1, 1 ];
  unique_num = unique_count ( xyz );
  fprintf ( 1, '  Number of uniques in %2d, %2d, %2d is %d\n', xyz, unique_num );
  xyz = [ 1, 1, 2 ];
  unique_num = unique_count ( xyz );
  fprintf ( 1, '  Number of uniques in %2d, %2d, %2d is %d\n', xyz, unique_num );
  xyz = [ 1, 1, 1 ];
  unique_num = unique_count ( xyz );
  fprintf ( 1, '  Number of uniques in %2d, %2d, %2d is %d\n', xyz, unique_num );

  return
end
function xy = xy_quad13 ( )

%*****************************************************************************80
%
%% xy_quad13() returns a 13 point quadrature rule for the reference triangle.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    28 March 2023
%
%  Author:
%
%    John Burkardt
%
%  Output:
%
%    real xy(13,2): the coordinates of the quadrature points in the
%    reference triangle.
%
  xy = [
    3.33333333333333e-01, 3.33333333333333e-01; ...
    2.60345966079040e-01, 2.60345966079040e-01; ...
    2.60345966079040e-01, 4.79308067841920e-01; ...
    4.79308067841920e-01, 2.60345966079040e-01; ...
    6.51301029022160e-02, 6.51301029022160e-02; ...
    6.51301029022160e-02, 8.69739794195568e-01; ...
    8.69739794195568e-01, 6.51301029022160e-02; ...
    3.12865496004874e-01, 6.38444188569810e-01; ...
    6.38444188569810e-01, 4.86903154253160e-02; ...
    4.86903154253160e-02, 3.12865496004874e-01; ...
    3.12865496004874e-01, 4.86903154253160e-02; ...
    6.38444188569810e-01, 3.12865496004874e-01; ...
    4.86903154253160e-02, 6.38444188569810e-01 ];

  return
end
