Skip to content

vec3RandomUnit

vec3RandomUnit(rand?): Vec3

Defined in: src/modules/math/vec3.ts:136

A uniformly distributed point on the unit sphere — every result has length 1, unlike a naive per-axis random in [-1, 1] which biases toward the corners.

rand is a [0, 1) source, typed structurally so this module needs no import for it. Pass a seeded modules/rng generator when the field must be reproducible.

() => number

Vec3