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.

14 lines (13 loc) 582 B
/** * Checks if a 4D vector has infinite components. * @param {ArrayVector4D} xyzw - Vector as `[x, y, z, w]` * @returns {boolean} `true` if vector has infinite components, `false` otherwise */ export const isInfinite4D = (xyzw) => xyzw[0] === Number.POSITIVE_INFINITY || xyzw[0] === Number.NEGATIVE_INFINITY || xyzw[1] === Number.POSITIVE_INFINITY || xyzw[1] === Number.NEGATIVE_INFINITY || xyzw[2] === Number.POSITIVE_INFINITY || xyzw[2] === Number.NEGATIVE_INFINITY || xyzw[3] === Number.POSITIVE_INFINITY || xyzw[3] === Number.NEGATIVE_INFINITY;