I am looking for help with a stable random function. I have a rectangle that can be various sizes. So let's say 100 x 60. I would like to select a single point on it randomly. That's all simple.
One solution is to do it in linear fashion, so basically layout the entire surface area in points, so 100 x 60 would be a number from 0 to 5999.
That solves it without a problem, but I decided that I need a little variation in this, so another solution was do 2 random numbers, 0 to 99 and 0 to 59.
That second solution is the best for what I need, except I'm not a math expert so I wanted an opinion about this. If you have 2 consecutive random numbers from a set. So for example in the second example I would have 2 pairs. Then will the second pair still be derived from the first pair. I'm looking for a math function on this, because I can not plot the results in a process of elimination, or I get a variation in the length frequency.
Here is what I mean. I derive a pair 0 to 99 = 53 and 0 to 59 = 21 then in the second pair 0 to 99 = 11 and 0 to 59 = 40. If I add these to a table and randomly continue to generate pairs, then it will exhaust the table at random times, since most random number generators are very rough. This would give me a different average (frequency) every time.
So if I use the pair method, what would be the best way to go through the random numbers (is there a best way) and keep the frequency very tight for each evolution (complete table fill).
In case anyone is wondering, the reason the pair method works best for me, is the way I have updates running in a loop. This serves as a simulation and maybe later a game loop.
One solution is to do it in linear fashion, so basically layout the entire surface area in points, so 100 x 60 would be a number from 0 to 5999.
That solves it without a problem, but I decided that I need a little variation in this, so another solution was do 2 random numbers, 0 to 99 and 0 to 59.
That second solution is the best for what I need, except I'm not a math expert so I wanted an opinion about this. If you have 2 consecutive random numbers from a set. So for example in the second example I would have 2 pairs. Then will the second pair still be derived from the first pair. I'm looking for a math function on this, because I can not plot the results in a process of elimination, or I get a variation in the length frequency.
Here is what I mean. I derive a pair 0 to 99 = 53 and 0 to 59 = 21 then in the second pair 0 to 99 = 11 and 0 to 59 = 40. If I add these to a table and randomly continue to generate pairs, then it will exhaust the table at random times, since most random number generators are very rough. This would give me a different average (frequency) every time.
So if I use the pair method, what would be the best way to go through the random numbers (is there a best way) and keep the frequency very tight for each evolution (complete table fill).
In case anyone is wondering, the reason the pair method works best for me, is the way I have updates running in a loop. This serves as a simulation and maybe later a game loop.