function z = t_grid_complex ( grid_index )

%*****************************************************************************80
%
%% t_grid_complex() returns the complex number vertices for a T-puzzle grid.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    16 February 2022
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer GRID_INDEX: a grid index.
%    1: the T
%    2: the arrow
%    3: the rhombus
%    4: the fat arrow
%
%  Output:
%
%    character W(WN): the boundary word.
%
  s = sqrt ( 2.0 );
%
%  T
%
  if ( grid_index == 1 )
    z = [ 2, 2, 1,  1,  0, 0, -1, -1, 2 ] - 1/2 ...
      + [ 2, 1, 1, -2, -2, 1,  1,  2, 2 ] * i;
%
%  Arrow
%
  elseif ( grid_index == 2 )
    z = [ 0, 2, 2-s, 2-s,  1-s, 1-s, -2, 0 ] ...
      + [ 2, 0, 0,  -2,   -2,   0,    0, 2 ]*i;
%
%  Rhombus
%
  elseif ( grid_index == 3 )
    z = [ 1,  3,  0, -2, 1 ] - 1/2 ...
      + [ 1, -1, -1,  1, 1 ] * i;
%
%  Fat Arrow
%
  elseif ( grid_index == 4 )
    z = [ 0, 2, 1,  1, -1, -1, -2, 0 ] ...
      + [ 2, 0, 0, -1, -1,  0,  0, 2 ] * i;
  else
    fprintf ( 1, '\n' );
    fprintf ( 1, 't_grid_complex(): Fatal error!\n' );
    fprintf ( 1, '  Illegal grid index %d\n', grid_index );
    error ( 't_grid_complex(): Fatal error!\n' );
  end

  return
end

