Documentation / @ripl/core / Box
Class: Box
Defined in: packages/core/src/math/structs.ts:2
An axis-aligned bounding box defined by its four edges.
Constructors
Constructor
new Box(
top,left,bottom,right):Box
Defined in: packages/core/src/math/structs.ts:4
Parameters
| Parameter | Type | Description |
|---|---|---|
top | number | The y-coordinate of the box's top edge. |
left | number | The x-coordinate of the box's left edge. |
bottom | number | The y-coordinate of the box's bottom edge. |
right | number | The x-coordinate of the box's right edge. |
Returns
Box
Properties
Accessors
height
Get Signature
get height():
number
Defined in: packages/core/src/math/structs.ts:26
The vertical span of the box.
Returns
number
width
Get Signature
get width():
number
Defined in: packages/core/src/math/structs.ts:21
The horizontal span of the box.
Returns
number
Methods
empty()
staticempty():Box
Defined in: packages/core/src/math/structs.ts:16
Creates a zero-sized box at the origin.
Returns
Box