@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) • 351 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.magnitudeSq2D = void 0;
/**
* Calculate the squared magnitude of a 2D vector.
* @param {ArrayVector2D} xy - Vector as `[x, y]`
* @returns {number} Squared magnitude
*/
const magnitudeSq2D = (xy) => xy[0] ** 2 + xy[1] ** 2;
exports.magnitudeSq2D = magnitudeSq2D;