Boost logo

Boost Users :

Subject: Re: [Boost-users] boost random in 2 dimensions
From: Norbert Wenzel (norbert.wenzel.lists_at_[hidden])
Date: 2013-01-28 16:02:34


On 01/28/2013 10:35 PM, Robert Patterson wrote:
> @Norbert
> i think this could do uniform distribution only over one co-ordinates.
>
> I am assuming you want to sample a point uniformly at random from a
> rectangular subset of the plane with the sides of the rectangle parallel
> to the axes. If not, the problem is a little more complex, but still
> soluble. However, for a square of size 1 Norbert is correct.

I was assuming he uses one uniform_real_distribution to gain two values
in [0 1] and use these values (now in a 1x1 square) scaled into the
desired rectangle of arbitrary size.
Would this result in perfectly random values or would the scaling of the
random values introduce some artefacts that might deteriorate the
initial randomness?

Norbert


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net