-
Inverted GaussRandom()
So gaussRandom(0,10) the probability of a random value is closer to the middle value (5).
Is there an easy way to get an inverted gaussRandom(0,10), where the probability of a random value is closer to the min (0) and max (10) values? (See image)
This is my current solution:
seedRandom(index+1,true);
minValue = 0;
maxValue = 10;
middleValue = (maxValue - minValue)/2;
a = gaussRandom(minValue,maxValue); //temporary gaussRandom
if (a < middleValue) {
b = linear(a,minValue,middleValue,middleValue,minValue);
} else {
b = linear(a,middleValue,maxValue,maxValue,minValue);
}
b; // inverted gaussRandom