@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.
12 lines (11 loc) • 429 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.subtract2D = void 0;
/**
* Subtracts a 2D vector from another.
* @param {ArrayVector2D} xy1 - First vector as `[x, y]`
* @param {ArrayVector2D} xy2 - Second vector as `[x, y]`
* @returns {ArrayVector2D} The difference between vectors
*/
const subtract2D = (xy1, xy2) => [xy1[0] - xy2[0], xy1[1] - xy2[1]];
exports.subtract2D = subtract2D;