import type { RandomSource, Vector2Like, Vector3Like } from '@flighthq/types/contract'; /** Pick a random element from `items`, returning `undefined` for an empty array. * * Does not mutate `items`. Deterministic: same `random` sequence → same picks. */ export declare function pick(random: RandomSource, items: Readonly): T | undefined; /** Return an exponentially-distributed random number with the given `rate` * (λ > 0, mean = 1/λ). * * Uses the inverse CDF method: `-ln(U) / rate` where U is uniform on (0, 1]. * Suitable for modeling inter-arrival times in a Poisson process, particle * lifetimes, and decay events. * * The result is always non-negative. Throws if `rate` is non-finite or not positive. * * Deterministic: same `random` sequence → same output sequence. */ export declare function randomExponential(random: RandomSource, rate?: number): number; /** Return a normally-distributed random number with the given `mean` and * `standardDeviation`, using the Box–Muller transform. * * Each call consumes two values from `random` and discards one (the simplest * variant — use `randomGaussianPair` if you need both). The result can be any * finite number; it is not clamped. * * Deterministic: same `random` sequence → same output sequence. */ export declare function randomGaussian(random: RandomSource, mean?: number, standardDeviation?: number): number; /** Return two independent normally-distributed random numbers as `[z0, z1]` * sharing the same Box–Muller pair. * * Prefer this over calling `randomGaussian` twice when both samples are * needed — it consumes exactly 2 values from `random` instead of 4. */ export declare function randomGaussianPair(random: RandomSource, mean?: number, standardDeviation?: number): readonly [number, number]; /** Sample a uniformly-distributed point inside the unit disc (including the * boundary) and write it into `out.x` / `out.y`. * * Uses rejection sampling to avoid the over-dense centre that polar-radius * sampling without a square-root correction produces. * * The `out` parameter may be the same object as any other argument (alias-safe). * No allocation. */ export declare function randomInsideUnitDisc(random: RandomSource, out: Vector2Like): void; /** Sample a uniformly-distributed point inside the unit sphere (radius ≤ 1) * and write it into `out.x` / `out.y` / `out.z`. * * Uses 3D box rejection sampling: repeatedly draw from [-1, 1]³ until the * point is inside the sphere. Expected draws per call ≈ 1.91 (sphere:cube * volume ratio π/6 ≈ 0.524, so ~1.9× draws on average — fast in practice). * * The `out` parameter may be the same object as any other argument (alias-safe: * all reads are complete before any write). No allocation. */ export declare function randomInsideUnitSphere(random: RandomSource, out: Vector3Like): void; /** Sample a uniformly-distributed point on the unit circle and write it into * `out.x` / `out.y`. The result has unit length (x² + y² = 1). * * The `out` parameter may be the same object as any other argument (alias-safe: * all reads complete before any write). No allocation. */ export declare function randomOnUnitCircle(random: RandomSource, out: Vector2Like): void; /** Sample a uniformly-distributed point on the surface of the unit sphere * and write it into `out.x` / `out.y` / `out.z`. * * Uses the Marsaglia (1972) method — two uniform samples → rejection → a point * on the sphere. The result has unit length (x² + y² + z² = 1). * * The `out` parameter may be the same object as any other argument (alias-safe). * No allocation. */ export declare function randomOnUnitSphere(random: RandomSource, out: Vector3Like): void; /** Return a Poisson-distributed random integer with mean `lambda` (λ > 0). * * Uses Knuth's multiplicative algorithm: multiply independent uniform samples * until their product falls below `exp(-λ)`. Accurate and simple for small * `lambda` (λ ≤ ~30); for large lambda, `randomGaussian(random, lambda, * Math.sqrt(lambda))` is a faster approximation. * * The result is a non-negative integer. Throws if `lambda` is non-finite or not positive. * * Deterministic: same `random` sequence → same output sequence. */ export declare function randomPoisson(random: RandomSource, lambda?: number): number; /** Return a random index from a weight array, selected proportionally to * each weight. Weights do not need to sum to 1. * * Returns `-1` for an empty or all-zero weight array. * * Useful for weighted spawn rules in particle emitters. */ export declare function randomWeighted(random: RandomSource, weights: Readonly): number; /** Return a new array with the elements of `items` shuffled in a random order * (Fisher–Yates / Knuth shuffle). Allocates a copy; does not mutate `items`. * * Deterministic: same `random` state → same shuffled order. */ export declare function shuffle(random: RandomSource, items: Readonly): T[]; /** Shuffle `items` in place using the Fisher–Yates algorithm. * * Mutates `items`. Deterministic: same `random` state → same shuffled order. */ export declare function shuffleInPlace(random: RandomSource, items: T[]): void; //# sourceMappingURL=randomDistributions.d.ts.map