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) 484 B
/** * Checks if a vector has infinite components. * @param {ArrayVector3D} xyz - Vector as `[x, y, z]` * @returns {boolean} `true` if the vector has infinite components, `false` otherwise */ export const isInfinite3D = (xyz) => xyz[0] === Number.POSITIVE_INFINITY || xyz[0] === Number.NEGATIVE_INFINITY || xyz[1] === Number.POSITIVE_INFINITY || xyz[1] === Number.NEGATIVE_INFINITY || xyz[2] === Number.POSITIVE_INFINITY || xyz[2] === Number.NEGATIVE_INFINITY;