function z = t_rotate_complex ( z, r )

%*****************************************************************************80
%
%% t_rotate_complex() returns the complex vertex coordinates for a rotated object.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    11 February 2022
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    complex Z(ZN): the complex vertex coordinates.
%
%    integer R: indicates the number of 90 degree rotations, which should 
%    be 0, 1, 2, or 3.
%
%  Output:
%
%    complex Z(ZN): the complex vertex coordinates of the rotated object.
%
  if ( r ~= 0 )
    theta = r * pi / 2.0;
    c = cos ( theta );
    s = sin ( theta );
    x = real ( z );
    y = imag ( z );
    z = c*x-s*y + (s*x+c*y)*i;
  end

  return
end

