POV-Ray : Newsgroups : povray.advanced-users : Random number generator needed ! : Re: Random number generator needed ! Server Time
30 Jul 2024 00:29:40 EDT (-0400)
  Re: Random number generator needed !  
From: Geoff Wedig
Date: 26 Feb 2001 08:32:40
Message: <3a9a5af8@news.povray.org>
Rune <run### [at] inamecom> wrote:

> "Geoff Wedig" wrote:
>> Ok, so you want a random stream created based on two numbers,
>> but one that doesn't show obvious connection to the strems based
>> on any other two numbers.

> Actually I need not a random stream but just a random number, i.e.:
> I want a random number created based on two input numbers, but one
> that doesn't show obvious connection to the random numbers based on
> any other two input numbers.

> The problem is exactly the same though.

>> Ie, you need multiple random streams that are also random with
>> regards to each other.
>>
>> Is that correct?

> Sort of but not quite. I need not streams, just random numbers, but the
> problem is to create those random numbers without using streams.

> random(2,3)
> random(2,4)
> random(2,5)
> random(2,6)

> There should be no connection between those numbers above.

Ok, well, one possibility is using the seed (n1 * x1 + n2 * x2) where x1 and
x2 are large.  This might work, but I'm not certain.

Are the values always that small?  If so, the n2'th value from stream
initialized with n1 would work, but wouldn't work in the case:

random(1,2)
random(2,2)
random(3,2)

ie, it wouldn't be symmetricly random (can you even talk about such
things?).  Dunno if that's an issue, though.

Geoff


Post a reply to this message

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