function [ x, y ] = ij_to_xy ( i, j )

%*****************************************************************************80
%
%% ij_to_xy converts a point's (i,j) coordinates to (x,y) form.
%
%  Discussion:
%
%    The (i,j) coordinates refer to a parallelogram whose basic cell
%    is the unit parallelogram outlined by 
%      (0,0) --> (1,0) --> (1+c,s) --> (c,s).
%
%         *-----*
%        /     /
%       /     /
%      *-----*
%
%    where c = cos(60) = 0.5 and s = sin(60) = sqrt(3)/2.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    25 August 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer I, J, the parallelogram coordinates of a point.
%
%  Output:
%
%    real X, Y: the Cartesian coordinates of the point.
%
  c = cos ( pi / 3.0 );
  s = sin ( pi / 3.0 );

  x = i + j * c;
  y =     j * s;

  return
end

