Grasshopper

algorithmic modeling for Rhino

Random Set of Numbers Containing Both Negative and Positive Numbers

I was trying to generate a list of random numbers containing both negative and positive numbers. The Range is -25 to 25, Number is 10 for example.

The result I get is either a list of positive number or a list of negative number, depending on whether the seed is even or odd.

Is there a way I can generate list of mixture of radioman positive and negative numbers?

Thanks!

Views: 1339

Replies to This Discussion

generate a list of random numbers 0-50, then subtract 25

That's weird.. I've never encountered any such bias with the Random component..

Sorry. My bad. Totally bad description of the problem.

I actually have a list of Ranges/Domain. From each of the range, I want to randomly generate a number.

The result contain either all positive number or negative number depends on the whether the seed is even or odd.

Appreciated if you can help me take look.

As random seed is the same the random gives always a number that has the same relative position in all the ranges. You must provide the same number of seeds (random) as the number of ranges.
For example with a seed of 2 and range 0 to 1 random gives x value, for range 0 to y it must give a value x*y !

what ^ said.

Alternatively, as you only use one number per range, you could generate more numbers with just the one seed, then just remap it on to the ranges.

Thanks.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service