bounding-box-overlap-test
test if two n-dimensional bounding boxes overlap
example
var overlap =var a = 38 -15-11 100110var b = 15 -12-5 80140var c = -46 -100 7090console // trueconsole // falseconsole // true
api
var overlap =
overlap(a, b, opts={})
Return whether the bounding box a
intersects the bounding box b
.
Bounding boxes are arrays of 2-element [min,max]
array pairs, one for each
coordinate.
opts.cmp(a, b)
- provide your own custom comparison function or array of comparison functions
Comparison functions should return -1
, 0
, or 1
for less than, equal to,
and greater than cases, respectively.
If opts.cmp
is an array, each item in the array should be a comparison
function for the respective dimension.
install
npm install bounding-box-overlap-test
license
BSD