POV-Ray : Newsgroups : povray.general : 2Q's: normal & random : A random trick Server Time
12 Aug 2024 13:23:05 EDT (-0400)
  A random trick  
From: Tim Glover
Date: 12 Feb 1999 11:15:36
Message: <36C45410.499B@nettally.com>
Most random number generators produce uniform-distributed 
random numbers, not normally -distributed random numbers.  
There's an old programmer's trick (at least as old as 
FORTRAN 4) to approximate normal distributions from uniform
ones....  take TWO uniform randoms of half the range and add 
them together to get final value!

Hope this helps

Tim Glover
tgl### [at] nettallycom


ingo wrote:
> 


SNIP

> 2. How do I generate random numbers between -30 and +30, in such a way that
> there are mutch more between -15 and 15 than between -30 and 30?
> 

SNIP


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.