circular random number distribution

Heiko Bauke Heiko.Bauke@Physik.Uni-Magdeburg.DE
Tue Aug 9 11:47:00 GMT 2005


Hi,

On Tue, 09 Aug 2005 12:33:23 +0200
Jochen Küpper <jochen@fhi-berlin.mpg.de> wrote:

> "Robert G. Brown" <rgb@phy.duke.edu> writes:
> 
> > In fact, your sqrt call is redundant
> 
> Well, that's the deal: It isn't!
> 
> Without the sqrt, the functions are peaked at the center. With the
> sqrt they are uniform.

I think, he meant the sqrt in

,----
| do {
|     x = gsl_ran_flat(rng, -1, 1);
|     y = gsl_ran_flat(rng, -1, 1);
| } while(sqrt(x*x + y*y) > 1.);
`----

	Heiko

-- 
-- Die meisten Meinungen kommen zustande, indem man vergißt, wo man sie
-- gehört oder gelesen hat.
-- (Moritz Heimann, dt. Schriftsteller, 1868-1925)
-- Heiko Bauke @ http://www.uni-magdeburg.de/bauke



More information about the Gsl-discuss mailing list