Type of immutable boxes of integers
Module OgamlMath.IntBox
Operations on integer boxesThis module defines the IntBox type and various operations on it.
create position size
creates a box at position position
and of size size
create_from_points p1 p2
creates a box going from p1
to p2
Zero box
Unit box
Returns the position of a box
Returns the absolute position of a box, that is the point of minimal coordinates
Returns the top corner (aka position + size) of a box
Returns the absolute corner of a box, that is the point of maximal coordinates
normalize box
returns a box equivalent to box
but with positive size
Returns the size of a box
Returns the absolute size of a box
Returns the center of a box
Returns the volume of a box
Scales a box
Adds a vector to the dimensions of a box. Be careful since if the box is not normalized, adding a positive vector may reduce the effective size of the box.
Translates a box
intersects t1 t2
returns true
iff the boxes t1
and t2
overlap
includes t b
returns true
iff the box b
is included in the box t
contains t p
returns true
iff the box t
contains p
if
strict
is set to true
then upper bounds are not included (false
by default)
iter t f
iterates through all points of the box t
if
strict
is set to false
then upper bounds are included (true
by default)
fold t f u
folds through all points of the box t
if
strict
is set to false
then upper bounds are included (true
by default)
Returns a pretty-printed string (not for serialization)