Anonymous user
Talk:Random numbers: Difference between revisions
no edit summary
No edit summary |
No edit summary |
||
Line 21:
:: The base of the logarithm could indeed explain the standard deviation; using base 10 instead of base 2 would add a factor of sqrt(1/ln(10)), which indeed is just about 0.66. The second thing to check is the cosine: If MAXScript takes the argument of the cosine in degrees instead of radians, then in the formula the value 2*pi must be replaced by 360.
:: Additional note: Usually floating random number generators give numbers from the interval [0,1) (i.e. 0 included, 1 excluded). However this algorithm needs random numbers from (0,1] (0 excluded, 1 included). It doesn't really matter for b, but for a the value 0 would be fatal (the logarithm isn't defined at value 0). Thus you should check what the random number generator does, and in case it's indeed using the interval [0,1), use <tt>1.0 - random 0.0 1.0</tt> instead. --[[User:Ce|Ce]] 12:26, 21 September 2007 (MDT)
:::Thanks guys, it turned out to be cos expecting degrees rather than radians and I've fixed it now.
:::
|