Showing posts with label probability. Show all posts
Showing posts with label probability. Show all posts

Wednesday, 8 October 2025

remap "probability" of random CHANDOM

rand(@ptnum) will give you a distribution between 0 and 1.
fit01 will let you remap this random value between a given minimum and maximum.

But what if you want to have more of the larger values, or mostly small values.. or even just the values inbetween?

We can remap the initial rand(@ptnum) using a chramp.

eg. chramp("remap",rand(@ptnum);

displaying the ramp will let us draw a curve and affect the values.
So below, we will have very few small values and mostly large ones. 
The code is - f@restlength*=fit01(chramp("remap",rand(@hairID)),chf("min"),chf("max"));
Pay attention to the brackets.