function [ xy, seed ] = disk_unit_sample ( n, seed )

%*****************************************************************************80
%
%% disk_unit_sample returns sample points from the unit disk.
%
%  Discussion:
%
%    The unit circle has center at the origin, and radius 1.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license. 
%
%  Modified:
%
%    16 December 2013
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer N, the number of points.
%
%    Input/output, integer SEED, a seed for the random number generator.
%
%    Output, real XY(2,N), the points.
%
  [ r, seed ] = r8vec_uniform_01 ( n, seed );
  r(1:n) = sqrt ( r(1:n) );

  [ t, seed ] = r8vec_uniform_01 ( n, seed );
  t(1:n) = 2.0 * pi * t(1:n);

  xy(1,1:n) = r(1:n) .* cos ( t(1:n) );
  xy(2,1:n) = r(1:n) .* sin ( t(1:n) );

  return
end
