random generation of a '-1' or '1' flag?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-10-13 11:33 AM
‎2004-10-13
11:33 AM
is there any way i can create a random '-1' or '1' flag for a random positive/negative ADD and ROT command?
i can generate the random amount i want to offset/rotate, but i want to multiple by the -1 or 1 as well for a truer randomisation.
hoping . . .
~/archiben
b e n f r o s t
b f [a t ] p l a n b a r c h i t e c t u r e [d o t] n z
archicad | sketchup! | coffeecup
b f [a t ] p l a n b a r c h i t e c t u r e [d o t] n z
archicad | sketchup! | coffeecup
3 REPLIES 3
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-10-13 11:56 AM
‎2004-10-13
11:56 AM
You can use the RND function for this.
Page 2.40 of the Cookbook look also at the chapter Maths bits.
Not sure if it is exactly what you are asking for, but may be this can help.
Page 2.40 of the Cookbook look also at the chapter Maths bits.
Not sure if it is exactly what you are asking for, but may be this can help.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-10-13 12:27 PM
‎2004-10-13
12:27 PM
Ben;
Try playing with the below...
HTH - Stuart
_____________________________
!*** Ben's Random Flag v1.0 ***
oRandom = rnd(0.9999999)
if oRandom > 0.5 then oFlag = +1 else oFlag = -1
text2 0,0, oFlag
!*** Ben's Random Flag v2.0 ***
oFlag = 2*(int(rnd(1.99999)))-1
!*** Ben's Random Angle v1.0 ***
oMinimumAngle = -90
oMaximumAngle = +90
oRotation = rnd (oMaximumAngle - oMinimumAngle) +oMinimumAngle
Try playing with the below...
HTH - Stuart
_____________________________
!*** Ben's Random Flag v1.0 ***
oRandom = rnd(0.9999999)
if oRandom > 0.5 then oFlag = +1 else oFlag = -1
text2 0,0, oFlag
!*** Ben's Random Flag v2.0 ***
oFlag = 2*(int(rnd(1.99999)))-1
!*** Ben's Random Angle v1.0 ***
oMinimumAngle = -90
oMaximumAngle = +90
oRotation = rnd (oMaximumAngle - oMinimumAngle) +oMinimumAngle
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-10-15 03:35 PM
‎2004-10-15
03:35 PM
thanks guys!
~/archiben

~/archiben
b e n f r o s t
b f [a t ] p l a n b a r c h i t e c t u r e [d o t] n z
archicad | sketchup! | coffeecup
b f [a t ] p l a n b a r c h i t e c t u r e [d o t] n z
archicad | sketchup! | coffeecup