random() returns a value in [0, 1), random(max) one in [0, max) and random(min, max) one in [min, max).
Parameters
Name
Type
Description
Default
a
float | None
The upper bound, or the lower bound when b is given; 1 if omitted.
None
b
float | None
The upper bound, when a is the lower bound.
None
Returns
Name
Type
Description
float
A uniformly distributed float.
random_gaussian
random_gaussian(mean=0.0, std_dev=1.0)
Returns a normally distributed random float.
Parameters
Name
Type
Description
Default
mean
float
The mean.
0.0
std_dev
float
The standard deviation.
1.0
Returns
Name
Type
Description
float
A float drawn from a normal distribution.
random_seed
random_seed(seed)
Seeds the random generator, making random calls repeatable.
Parameters
Name
Type
Description
Default
seed
int
The seed.
required
noise
noise(x, y=None, z=None, w=None)
Returns simplex noise in [0, 1] at a 1D to 4D position.
The dimension is the number of coordinates given. Pass floats for a float back, or numpy arrays (any shape; they are broadcast together) for an array back with the same values as the scalar version, to within 1e-6. Nearby inputs give nearby outputs, so scaling the coordinates sets the feature size: noise(x * 0.01) is smooth over about a hundred units.
Parameters
Name
Type
Description
Default
x
Arr
First coordinate.
required
y
Arr | None
Second coordinate, for 2D noise and up.
None
z
Arr | None
Third coordinate, for 3D noise and up.
None
w
Arr | None
Fourth coordinate, for 4D noise.
None
Returns
Name
Type
Description
Arr
The noise value, a float or an ndarray.
signed_noise
signed_noise(x, y=None, z=None, w=None)
Returns simplex noise in [-1, 1] at a 1D to 4D position.
The dimension is the number of coordinates given. Pass floats for a float back, or numpy arrays (any shape; they are broadcast together) for an array back with the same values as the scalar version, to within 1e-6. The result is deterministic and continuous.