function P = rectangle_sample ( n, a, b )

%*****************************************************************************80
%
%% rectangle_sample() samples points from a rectangle.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    08 May 2023
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer n: the number of sample points.
%
%    real a, b: the lengths of the two sides of the rectangle.
%
%  Output:
%
%    real P(n,2): randomly selected points.
%
  S = [   a, 0.0; 
        0.0, b ];

  R = rand ( n, 2 );

  P = R * S;

  return
end

