function v2 = vertex_reflect ( v, r )

%*****************************************************************************80
%
%% vertex_reflect() reflects a polyiamond described by its vertex list.
%
%  Discussion:
%
%    The vertex list of a polyiamond gives the IJ coordinates of the
%    polygonal vertices, in counterclockwise order.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 November 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer V(VN,2): the vertex list.
%
%    integer R: the reflection option.
%    0: no reflection;
%    1: reflect about the I axis;
%    2: reflect about the J axis;
%    3: reflect about both I and J axes.
%
%  Output:
%
%    integer V2(VN,2): the vertex list for the reflected polyiamond.  
%
  v2 = v;

  if ( r == 1 )
    v2(:,1) = - v2(:,1) - v2(:,2);
  elseif ( r == 2 )
    v2(:,1) =   v2(:,1) + v2(:,2);
    v2(:,2) = - v2(:,2);
  elseif ( r == 3 )
    v2(:,1) = - v2(:,1);
    v2(:,2) = - v2(:,2);
  end

  return
end

