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) 352 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.immutable2D = void 0; /** * Create an immutable 2D vector. * @param {ArrayVector2D} xy - Vector as `[x, y]` * @returns {Readonly<ArrayVector2D>} The immutable vector */ const immutable2D = (xy) => Object.freeze([xy[0], xy[1]]); exports.immutable2D = immutable2D;