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.

9 lines (8 loc) 376 B
import type { ArrayVector4D } from "./types.js"; /** * Normalizes a 4D vector to unit length. * @param {ArrayVector4D} xyzw - Vector as `[x, y, z, w]` * @param {number} [m] - Optional current magnitude (default: `magnitude4D(xyzw)`) * @returns {ArrayVector4D} The normalized vector */ export declare const normalize4D: (xyzw: ArrayVector4D, m?: number) => ArrayVector4D;