function [ xy, seed ] = quad_simple_random ( seed )

%*****************************************************************************80
%
%% QUAD_SIMPLE_RANDOM returns a random simple quadrilateral.
%
%  Description:
%
%    The quadrilateral is constrained in that the vertices must all lie
%    with the unit square.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    01 August 2018
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer SEED, a seed for the random number generator.
%
%    Output, real XY(2,4), the coordinates of the nodes of the quadrilateral.
%
%    Output, integer SEED, a seed for the random number generator.
%
  while ( true )
%
%  Generate 4 random points.
%
    [ xy, seed ] = quad_random ( seed );
%
%  Break if the quadrilateral is simple.
%
    if ( quad_is_simple ( xy ) )
      break
    end

  end

  return
end
