@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.
10 lines (9 loc) • 395 B
JavaScript
/**
* Checks if a vector has infinite components.
* @param {ArrayVector2D} xy - Vector as `[x, y]`
* @returns {ArrayVector2D} `true` if the vector has infinite components, `false` otherwise
*/
export const isInfinite2D = (xy) => xy[0] === Number.POSITIVE_INFINITY ||
xy[0] === Number.NEGATIVE_INFINITY ||
xy[1] === Number.POSITIVE_INFINITY ||
xy[1] === Number.NEGATIVE_INFINITY;