https://github.com/semibran/rect
Basic helper methods for rectangles
https://github.com/semibran/rect
rect rectangle
Last synced: 5 months ago
JSON representation
Basic helper methods for rectangles
- Host: GitHub
- URL: https://github.com/semibran/rect
- Owner: semibran
- License: mit
- Created: 2017-01-31T18:56:09.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-25T05:20:58.000Z (over 8 years ago)
- Last Synced: 2025-04-06T13:12:39.793Z (10 months ago)
- Topics: rect, rectangle
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# rect
> Basic helper methods for rectangles
The following methods can work on any objects of the form `{ x, y, width, height }`.
## install
```sh
npm install semibran/rect
```
## usage
```javascript
const { contains, intersects } = require('rect')
```
### `contains(a, b)`
Determines if rectangle `a` contains rectangle `b`.
### `equals(a, b)`
Determines if the four rectangle properties of `a` and `b` are equivalent.
## license
MIT