ConstFacade of the random generators and helpers. Each generator takes an optional configuration, described by its
Random***Config type and by the rnd*** function it forwards to; the helpers (number, bool, item…)
document their arguments below.
Up to number distinct elements of arr (default 1), in random order; arr is not modified.
true with the probability percent (between 0 and 1, default 0.5).
Random circle, from a center and a radius, optionally with integer points on it.
Random equation or inequality, with controlled solutions (solution.count, nothing, everything).
Random fraction or integer, with its sign, range and size under control.
Random element of arr.
Random line of the plane, from a point and a slope, with a chosen kind (vertical, horizontal, positive, negative).
Random line of space, from a point and a direction, with a chosen kind (general or parallel to a plane or an axis).
Random term such as 3x² or -½xy.
Random integer in [from, to], both bounds included (swapped if from > to), never one of exclude.
Random integer in [-max, max]; allowZero: false excludes 0.
Random point of the plane, constrained by axis, quadrant and range.
Random point of space, constrained by axis, plane, octant and range.
Random polynomial of a given degree, possibly factorable into linear factors.
Random prime strictly lower than max (any prime of the list when max is omitted).
Shuffled copy of arr; arr is not modified.
Random Pythagorean triplet whose hypotenuse is target, or null when there is none.
Triplets that contain 0 are left out unless allowZero is true.
Random vector of the plane, drawn like a point; the zero vector is excluded by default.
Random vector of space, drawn like a point; the zero vector is excluded by default.
Global PiMath object for non-module contexts (e.g. script tags). Named exports from this module cover the full public API, including types from
pimath.interfaceand theRandom/Numericutilities.