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) 372 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.magnitudeSq3D = void 0; /** * Calculate the squared magnitude of a 3D vector. * @param {ArrayVector3D} xyz - Vector as `[x, y, z]` * @returns {number} Squared magnitude */ const magnitudeSq3D = (xyz) => xyz[0] ** 2 + xyz[1] ** 2 + xyz[2] ** 2; exports.magnitudeSq3D = magnitudeSq3D;