Contains BoundingCircle and BoundingRectangle. Exports BoundingRectangle by default.
npm install @zubry/boundary --save
import Boundary from '@zubry/boundary'; // imports BoundingRectangle
import { BoundingRectangle, BoundingCircle } from '@zubry/boundary'; // imports both classes
const rect = new BoundingRectangle({ center: new Position(5, 5), rotation: new Position(45), height: 10, width: 5 });
const circle = new BoundingCircle({ center: new Position(5, 5), radius: 10 });
Both classes have the same API
Shifts the boundary by the given amount (position)
Scales the boundary by the given amount (scalar)
Rotates the boundary by the given amount (angle/position)
Checks if the boundary intersects the given boundary
Returns the area of the boundary