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.

12 lines (11 loc) 520 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isOpposite4D = void 0; /** * Checks if two 4D vectors are opposite. * @param {ArrayVector4D} xyzw1 - First vector as `[x, y, z, w]` * @param {ArrayVector4D} xyzw2 - Second vector as `[x, y, z, w]` * @returns {boolean} `true` if vectors are opposite */ const isOpposite4D = (xyzw1, xyzw2) => xyzw1[0] === -xyzw2[0] && xyzw1[1] === -xyzw2[1] && xyzw1[2] === -xyzw2[2] && xyzw1[3] === -xyzw2[3]; exports.isOpposite4D = isOpposite4D;