Library
Module
Module type
Parameter
Class
Class type
type t = box1
The type for 1D boxes (closed intervals).
dim
is the dimension of the boxes of type box2
.
type size = size1
The type for 1D sizes.
The type for matrices representing linear transformations of 1D space.
val empty : box1
empty
is the empty box.
val o : box1 -> float
o b
is the origin of b
.
val ox : box1 -> float
ox b
is o b
.
val w : box1 -> float
w b
is size b
.
val zero : box1
zero
is a box whose origin and size is zero.
val unit : box1
unit
is the unit box which extends from zero to one in all dimensions.
val of_pts : float -> float -> box1
of_pts p p'
is the smallest box whose space contains p
and p'
.
val min : box1 -> float
min b
is the smallest point of b
(its origin).
val minx : box1 -> float
minx b
is min b
.
val max : box1 -> float
max b
is the greatest point of b
(its size added to the origin).
val maxx : box1 -> float
maxx b
is max b
.
val mid : box1 -> float
mid b
is the mid point between min
and max
.
val midx : box1 -> float
midx b
is mid b
.
val left : box1 -> float
left b
is minx b
.
val right : box1 -> float
right b
is maxx b
.
val area : box1 -> float
area b
is the surface area of b
.
inter b b'
is a box whose space is the intersection of S(b
) and S(b'
).
val is_pt : box1 -> bool
is_pt b
is true
iff b
is not empty
and its size is equal to 0 in every dimension.
val mem : float -> box1 -> bool
mem p b
is true
iff p
is in S(b
).
equal_f eq b b'
tests b
and b'
like equal
but uses eq
to test floating point values.
compare_f cmp b b'
compares b
and b'
like compare
but uses cmp
to compare floating point values.
val pp : Format.formatter -> box1 -> unit
pp ppf b
prints a textual representation of b
on ppf
.
val pp_f :
(Format.formatter -> float -> unit) ->
Format.formatter ->
box1 ->
unit
pp_f pp_fl ppf b
prints b
like pp
but uses pp_fl
to print floating point values.