### Installing intersects with NPM (Shell) Source: https://github.com/davidfig/intersects/blob/master/README.md Installs the 'intersects' library using the npm package manager. Use this command in your project directory to add it as a dependency. ```shell npm i intersects ``` -------------------------------- ### Installing intersects with Yarn (Shell) Source: https://github.com/davidfig/intersects/blob/master/README.md Installs the 'intersects' library using the Yarn package manager. Use this command in your project directory to add it as a dependency. ```shell yarn add intersects ``` -------------------------------- ### Browser Usage with Script Tag (HTML/JavaScript) Source: https://github.com/davidfig/intersects/blob/master/README.md Example of including the pre-packaged 'intersects' library directly in an HTML document using a script tag. The library exposes a global `Intersects` object containing all collision functions, demonstrated here with `polygonPoint`. ```html ``` -------------------------------- ### Specific Function Usage with require (JavaScript) Source: https://github.com/davidfig/intersects/blob/master/README.md Shows how to import only a specific collision function, `circleBox`, from the 'intersects' library using `require` to potentially optimize bundle size, then uses it to check for intersection between a circle and a box. ```javascript var circleBox = require('intersects/circle-box'); var intersected = circleBox(x, y, r, x1, y1, w1, h1); ``` -------------------------------- ### Basic Usage with require (JavaScript) Source: https://github.com/davidfig/intersects/blob/master/README.md Demonstrates how to import the entire 'intersects' library using `require` and use a specific collision function, `boxBox`, to check for intersection between two rectangles. ```javascript var intersects = require('intersects'); var intersected = intersects.boxBox(x1, y1, w1, h1, x2, y2, w2, h2); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.