This function generates n independent random points,
  uniformly distributed in the window win.
  (For nonuniform distributions, see rpoint.)
The algorithm depends on the type of window, as follows:
- If - winis a rectangle then 
    \(n\) independent random points, uniformly distributed
    in the rectangle, are generated by assigning uniform random values to their
    cartesian coordinates.
 
- If - winis a binary image mask, then a random sequence of 
    pixels is selected (using- sample)
    with equal probabilities. Then for each pixel in the sequence
    we generate a uniformly distributed random point in that pixel.
 
- If - winis a polygonal window, the algorithm uses the rejection
    method. It finds a rectangle enclosing the window,
    generates points in this rectangle, and tests whether they fall in
    the desired window. It gives up when- giveup * ntests
    have been performed without yielding- nsuccesses.
 
The algorithm for binary image masks is faster than the rejection
  method but involves discretisation.
If warn=TRUE, then a warning will be issued if n is very large.
  The threshold is spatstat.options("huge.npoints").
  This warning has no consequences,
  but it helps to trap a number of common errors.