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.

11 lines (10 loc) 490 B
import type { ArrayVector3D } from "./types.js"; /** * Clamps the magnitude of a vector between min and max. * @param {ArrayVector3D} xyz - Vector as `[x, y, z]` * @param {number} min - Minimum magnitude * @param {number} max - Maximum magnitude * @param {number} [m] - Optional current magnitude (default: `magnitude3D(xyz)`) * @returns {ArrayVector3D} The clamped vector */ export declare const clamp3D: (xyz: ArrayVector3D, min: number, max: number, m?: number) => ArrayVector3D;