@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.
10 lines (9 loc) • 422 B
TypeScript
import type { ArrayVector2D } from "./types.js";
/**
* Limits the maximum magnitude of a 2D vector.
* @param {ArrayVector2D} xy - Vector as `[x, y]`
* @param {number} max - Maximum magnitude
* @param {number} [m] - Optional current magnitude (default: `magnitude2D(xy)`)
* @returns {ArrayVector2D} The limited vector
*/
export declare const limitMax2D: (xy: ArrayVector2D, max: number, m?: number) => ArrayVector2D;