function symmetry = barycentric_symmetry ( xyz )

%*****************************************************************************80
%
%% barycentric_symmetry() does a barycentric quadrature symmetry test.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    28 March 2023
%
%  Author:
%
%    John Burkardt
%
  m = size ( xyz, 1 );
  symmetry = zeros ( m, 1 );

  for i = 1 : m
%
%  Are there 1, 2, or 3 unique values in this point?
%
    unique_num = unique_count ( xyz(i,1:3) );
%
%  Are there 1, 2, or 6 permutations of the values?
%
    clone_num = clone_count ( xyz(i,1:3), xyz );

    if ( unique_num == 1 )
      if ( nearly_equal ( xyz(i,1:3), [1/3,1/3,1/3] ) )
        symmetry(i) = 1;
      else
        symmetry(i) = 0;
      end
    elseif ( unique_num == 2 && clone_num == 3 )
      symmetry(i) = 3;
    elseif ( unique_num == 3 && clone_num == 6 )
      symmetry(i) = 6;
    end

  end

  return
end
