function r = user_rectangle_3d ( m, n )

%*****************************************************************************80
%
%% user_rectangle_3d() samples points in a user-specified region with given density.
%
%  Discussion:
%
%    This version of the USER routine is defined for a 3D rectangular
%    object [0,5] x [ -1, + 1] x [ 2, 4 ].
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 March 2010
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer DIM_NUM, the spatial dimension.
%
%    integer N, the number of sample points desired.
%
%  Output:
%
%    real R(DIM_NUM,N), a set of N sample values.
%
  
%
%  Sample points in the unit cube uniformly.
%
  r = rand ( 3, n );
%
%  Stretch the data from [0,1] x [0,1] x [0,1] to [0,5] x [-1,+1] x [2,4].
%
  r(1,1:n) =  0.0 + 5.0 * r(1,1:n);
  r(2,1:n) = -1.0 + 2.0 * r(2,1:n);
  r(3,1:n) =  2.0 + 2.0 * r(3,1:n);

  return
end
 
