|
![](/i/fill.gif) |
Rune <run### [at] iname com> wrote:
> "Geoff Wedig" wrote:
>> > wouldn't it work to make a relative small array, and then
>> > use averages of different numbers from the array?
>>
>> Those wouldn't be equally distributed though. The mean of
>> three uniformly distributed numbers is not uniformly
>> distributed.
> Yes, I realised that...
> Maybe instead of averaging I can just add together and then use mod() on the
> result. It may cause a kind of repeats in the pattern, but it should be
> possible to reduce it to a minimum.
How big are your numbers? You could use the nth value off the stream seeded
with m, if you're assured they're not too big (expensive, though)
Another possibility is using some sort of function to hash to a single
value. a*n1 + b*n2 which you then use as your seed, and get the random
number that way.
Geoff
Post a reply to this message
|
![](/i/fill.gif) |