randomTriangular

Returns a triangularly distributed random number between -1.0 (exclusive) and 1.0 (exclusive), where values around zero are more likely.

This is an optimized version of .randomTriangular


Returns a triangularly distributed random number between -max (exclusive) and max (exclusive), where values around zero are more likely.

This is an optimized version of .randomTriangular

Parameters

max

the upper limit


fun randomTriangular(min: Float, max: Float, mode: Float = (min + max) * 0.5f): Float

Returns a triangularly distributed random number between min (inclusive) and max (exclusive), where values around mode are more likely.

Parameters

min

the lower limit

max

the upper limit

mode

the point around which the values are more likely