Stupid Code Question
Moderators: BTT, andy55, b.dwall, juxtiphi
- JayPro
- Posts: 738
- Joined: Sat May 01, 2004 10:51 pm
- Location: Huntington Station, Long Island, New York
Stupid Code Question
When you have a rnd() equation like:
A0= "1 +rnd(1)"
is that the same as if using the number with there being no rand factoring at all?
If so, then why not just use "1"?
A0= "1 +rnd(1)"
is that the same as if using the number with there being no rand factoring at all?
If so, then why not just use "1"?
"God is syntax."
- JayPro
- Posts: 738
- Joined: Sat May 01, 2004 10:51 pm
- Location: Huntington Station, Long Island, New York
Thanks
So basically the rnd construct is kinda like multiplying:
I.E. 1+rnd(1) can be any integer from 1 to 2.
:. (therefore)
2 + rnd(5) can be anything from 2 to 10.
That said, I have a coupla further questions:
1. What does adding something like flor, sgn or sqrt do to the factorization (I know that sqr(rnd) increases randomness exponentially by whatever factor is reflected in the integers used) ?
2. How would changing the operator from + to * affect things? Would it be like using sqr(rnd) with plus?
Thanks.
So basically the rnd construct is kinda like multiplying:
I.E. 1+rnd(1) can be any integer from 1 to 2.
:. (therefore)
2 + rnd(5) can be anything from 2 to 10.
That said, I have a coupla further questions:
1. What does adding something like flor, sgn or sqrt do to the factorization (I know that sqr(rnd) increases randomness exponentially by whatever factor is reflected in the integers used) ?
2. How would changing the operator from + to * affect things? Would it be like using sqr(rnd) with plus?
Thanks.
"God is syntax."
No, 2 + rnd(5) would give a result between 2 and 7. Rnd(5) by itself would give 0-5.
1. Flor would return an integer somewhere in the range of the rnd, i.e. flor(rnd(5)) would return 0, 1, 2, 3, and 4. I'm not sure about 5 because rnd(5) might only goto 4.999999 or something. I could test it later....
Sgn just returns 0 or 1 I think, have to look it up. Sqrt would give the square root of whatever rnd returns. Sqr(rnd(5)) would square a number 0 to 5 resulting in 0 to 25. Could just use rnd(25) instead.
2. 2 * rnd(5) would return 0 thru 10. 2 + 2 * rnd(5) would return a number 2 thru 12, same as 2 + rnd(10).
Does that help?
1. Flor would return an integer somewhere in the range of the rnd, i.e. flor(rnd(5)) would return 0, 1, 2, 3, and 4. I'm not sure about 5 because rnd(5) might only goto 4.999999 or something. I could test it later....
Sgn just returns 0 or 1 I think, have to look it up. Sqrt would give the square root of whatever rnd returns. Sqr(rnd(5)) would square a number 0 to 5 resulting in 0 to 25. Could just use rnd(25) instead.
2. 2 * rnd(5) would return 0 thru 10. 2 + 2 * rnd(5) would return a number 2 thru 12, same as 2 + rnd(10).
Does that help?
- JayPro
- Posts: 738
- Joined: Sat May 01, 2004 10:51 pm
- Location: Huntington Station, Long Island, New York
Yes it did. Thanks.
I was gonna puke back a few examples of my own to make sure that I've got it understood. But a closer look at your examples make it clear.
So, then, you can use, I guess even exp(rnd) too, assuming you're daring enough to take randomization of your config to stellar heights.
I was gonna puke back a few examples of my own to make sure that I've got it understood. But a closer look at your examples make it clear.
So, then, you can use, I guess even exp(rnd) too, assuming you're daring enough to take randomization of your config to stellar heights.
"God is syntax."
For sgn (use sign, since sgn is deprecated) you would get a 1 for any number 0 or above. So using sign with rnd would be a waste unless you had the possibility of it going negative like sign(rnd(10) - 5). Result would be 0 if rnd(10) returned less than 5, 1 if 5 or greater.
Flor(rnd(1)) does, in fact, return a 1 cccasionally. My evidence is:
But if you want a colormap worth watching check this out:
P.S. You're welcome (I had started the post when you posted).
Flor(rnd(1)) does, in fact, return a 1 cccasionally. My evidence is:
Save as a colormap, if you wait awhile there will occasionally be some color meaning flor(rnd(1)) does sometimes return an integer of 1.R="flor(rnd(1))*i"
G="flor(rnd(1))*i"
B="flor(rnd(1))*i"
Vers=300
But if you want a colormap worth watching check this out:
Yessireedy, one of my best !!!CCal ="4 + rnd(4)"
R="rnd(1)*i"
G="rnd(1)*i"
B="rnd(1)*i"
Vers=300
P.S. You're welcome (I had started the post when you posted).
- JayPro
- Posts: 738
- Joined: Sat May 01, 2004 10:51 pm
- Location: Huntington Station, Long Island, New York
Matter Of Fact:
I've been config-engineering like a madman recently, hence my not being so much a talking presence on this board lately as a busy behind-the scenes Mod/spambuster (Now if *that* were a paying job...LMAO).
Anyhow, sometime early this week, I'll shoot a file of my latest brainchildren to both you and Andy for him to include in the Extras archives at his leisure (Every time I'd swear up and down for the past month and a half that I'd do just that, a new "engineering" binge would take hold; hence this excuse).
Teaser: Some of the flowfields IMD(irt)HO just may be my best ones yet. And a few of the Particle/WaveShapes aren't altogether plain either..............
I've been config-engineering like a madman recently, hence my not being so much a talking presence on this board lately as a busy behind-the scenes Mod/spambuster (Now if *that* were a paying job...LMAO).
Anyhow, sometime early this week, I'll shoot a file of my latest brainchildren to both you and Andy for him to include in the Extras archives at his leisure (Every time I'd swear up and down for the past month and a half that I'd do just that, a new "engineering" binge would take hold; hence this excuse).
Teaser: Some of the flowfields IMD(irt)HO just may be my best ones yet. And a few of the Particle/WaveShapes aren't altogether plain either..............
"God is syntax."
- JayPro
- Posts: 738
- Joined: Sat May 01, 2004 10:51 pm
- Location: Huntington Station, Long Island, New York
I'm actually gonna spend some time today crossing my fingers and see if 3.5's gonna work for me.
Once that's done, I'll start bundling my new effects and sending them to all germaine parties.
In any even, the intended recipients should have everything *at the latest* by late tonite/early mañana.
Once that's done, I'll start bundling my new effects and sending them to all germaine parties.
In any even, the intended recipients should have everything *at the latest* by late tonite/early mañana.
"God is syntax."