UNPKG

@fimbul-works/vec

Version:

A comprehensive TypeScript vector math library providing 2D, 3D, and 4D vector operations with a focus on performance and type safety.

8 lines (7 loc) 326 B
import type { ArrayVector2D } from "./types.js"; /** * Creates a random unit 2D vector. * @param {() => void} random - A function that returns a random number between 0 and 1 (default: `Math.random`) * @returns {ArrayVector2D} Random unit vector */ export declare const random2D: (random?: () => number) => ArrayVector2D;