Returns a random 2D point on a 0..1 scale.
import { Points } from "https://unpkg.com/ixfx/dist/geometry.js";const pt = Points.random(); // eg {x: 0.2549012, y:0.859301} Copy
import { Points } from "https://unpkg.com/ixfx/dist/geometry.js";const pt = Points.random(); // eg {x: 0.2549012, y:0.859301}
A custom source of randomness can be provided:
import { Points } from "https://unpkg.com/ixfx/dist/geometry.js";import { weightedSource } from "https://unpkg.com/ixfx/dist/random.js"const pt = Points.random(weightedSource(`quadIn`)); Copy
import { Points } from "https://unpkg.com/ixfx/dist/geometry.js";import { weightedSource } from "https://unpkg.com/ixfx/dist/random.js"const pt = Points.random(weightedSource(`quadIn`));
Optional
Returns a random 2D point on a 0..1 scale.
A custom source of randomness can be provided: