Returns a random positioned Rect on a 0..1 scale.
const r = Rects.random(); // eg {x: 0.2549012, y:0.859301, width: 0.5212, height: 0.1423 } Copy
const r = Rects.random(); // eg {x: 0.2549012, y:0.859301, width: 0.5212, height: 0.1423 }
A custom source of randomness can be provided:
import { Rects } from "@ixfx/geometry.js";import { weightedSource } from "@ixfx/random.js"const r = Rects.random(weightedSource(`quadIn`)); Copy
import { Rects } from "@ixfx/geometry.js";import { weightedSource } from "@ixfx/random.js"const r = Rects.random(weightedSource(`quadIn`));
Optional
Returns a random positioned Rect on a 0..1 scale.
A custom source of randomness can be provided: