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) 499 B
import type { ArrayVector4D } from "./types.js"; /** * Clamps the magnitude of a 4D vector between min and max. * @param {ArrayVector4D} xyzw - Vector as `[x, y, z, w]` * @param {number} min - Minimum magnitude * @param {number} max - Maximum magnitude * @param {number} [m] - Optional current magnitude (default: `magnitude4D(xyzw)`) * @returns {ArrayVector4D} The clamped vector */ export declare const clamp4D: (xyzw: ArrayVector4D, min: number, max: number, m?: number) => ArrayVector4D;