|
![](/i/fill.gif) |
In article <3afe4401$1@news.povray.org>, tla### [at] home com says...
> Thanks for the info! I'm trying to find out how to create random numbers
> between -0.75 and 0.75. I tried to come up with the function using your
> examples but I can't seem to get it right. The general for seems to be
This macro returns a random number between R_min and R_max
in your case use random(MySeed,-0.75,0.75)
#macro random(Myseed,R_min,R_max)
(rand(MySeed)*(R_max-R_min) + R_min)
#end
> Num = rand*x + y
> so
> -0.75 = 0.1*x +y and
> 0.75 = 0.9*x +y
Wrong.
-0.75 = 0*x+y
0.75 = 1*x+y
so
y = -0.75 // = R_min
x = 2*0.75 = 0.75 - (-0.75) // = R_max - R_min
Lutz-Peter
Post a reply to this message
|
![](/i/fill.gif) |