type tThe type for boxes.
val dim : intdim is the dimension of the boxes of type t.
type vThe type for dim vectors.
type pThe type for dim points.
type sizeThe type for dim sizes.
type mThe type for matrices representing linear transformations of dim space.
Constructors, accessors and constants
val v : p -> size -> tv o size is a box whose origin is o and size is size.
val v_mid : p -> size -> tv_mid mid size is a box whose mid point is mid and size is size.
val empty : tempty is the empty box.
val o : t -> po b is the origin of b.
- raises Invalid_argument
on empty
val size : t -> sizesize b is the size of b.
- raises Invalid_argument
on empty
val zero : tzero is a box whose origin and size is zero.
val unit : tunit is the unit box which extends from zero to one in all dimensions.
val of_pts : p -> p -> tof_pts p p' is the smallest box whose space contains p and p'.
val add_pt : t -> p -> tadd_pt b p is the smallest box whose space contains b and p.
val min : t -> pmin b is the smallest point of b (its origin).
- raises Invalid_argument
on empty
val max : t -> pmax b is the greatest point of b (its size added to the origin).
- raises Invalid_argument
on empty
val mid : t -> pmid b is the mid point between min and max.
- raises Invalid_argument
on empty
val area : t -> floatarea b is the surface area of b.
val inter : t -> t -> tinter b b' is a box whose space is the intersection of S(b) and S(b').
val union : t -> t -> tunion b b' is the smallest box whose space contains S(b) and S(b').
val inset : v -> t -> tinset d b is b whose edges are inset in each dimension according to amounts in d. Negative values in d outset. If the resulting size is negative returns empty. Returns empty on empty.
val round : t -> tround b is the smallest box containing b with integer valued corners. Returns empty on empty.
val move : v -> t -> tmove d b is b translated by d. Returns empty on empty.
val ltr : m -> t -> tltr m b is the smallest box containing the corners of b transformed by m. Returns empty on empty.
val map_f : (float -> float) -> t -> tmap_f f b is the box whose origin and size are those of b with their components mapped by f. Returns empty on empty.
Predicates and comparisons
val is_empty : t -> boolis_empty b is true iff b is empty.
val is_pt : t -> boolis_pt b is true iff b is not empty and its size is equal to 0 in every dimension.
val isects : t -> t -> boolisects b b' is not (is_empty (inter b b')).
val subset : t -> t -> boolsubset b b' is true iff S(b) is included in S(b').
val mem : p -> t -> boolmem p b is true iff p is in S(b).
val equal : t -> t -> boolequal b b' is b = b'.
val equal_f : (float -> float -> bool) -> t -> t -> boolequal_f eq b b' tests b and b' like equal but uses eq to test floating point values.
val compare : t -> t -> intcompare u v is Pervasives.compare u v.
val compare_f : (float -> float -> int) -> t -> t -> intcompare_f cmp b b' compares b and b' like compare but uses cmp to compare floating point values.