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.

7 lines (6 loc) 213 B
/** * Negates a 4D vector. * @param {ArrayVector4D} xyzw - Vector as `[x, y, z, w]` * @returns {ArrayVector4D} The negated vector */ export const negate4D = (xyzw) => [-xyzw[0], -xyzw[1], -xyzw[2], -xyzw[3]];