Skip to main content

are-boxes-intersecting

function areBoxesIntersecting(closed: boolean, a: number[][], b: number[][]): boolean

Defined in boxes/are-boxes-intersecting.ts:14

Returns true if the 2 given axis-aligned rectangular boxes intersect.

  • exact: not susceptible to floating point round-off
Note!
Green circles are draggable!
0

Parameters:

NameTypeDescription
closedbooleanif true, interpret boxes as being closed (i.e. they contain their border), otherwise open.
anumber[][]an axis-aligned rectangular box (given by an array of two points, e.g. [[1,2], [3,4]])
bnumber[][]another axis-aligned rectangular box