Determines the bounding box of some object.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
index.js
package.json
test.js

README.md

bounding box

Determine the bounding box of a rotated rectangle

Bounding Box

example

var bb = require('bounding-box')

var obj = {left: 221, top: 211, height: 220, width: 586}

console.log(bb(obj, 45))

With custom center point

var bb = require('bounding-box')

var obj = {left: 221, top: 211, height: 220, width: 586}

// Rotate from top/left corner (origin 0 0)
console.log(bb(obj, 45, {
  x: 221,
  y: 211
}))

install

With npm,

npm install bounding-box

license

BSD