Module Gg.Box1
type t
= box1
The type for 1D boxes (closed intervals).
val dim : int
dim
is the dimension of the boxes of typebox2
.
type size
= size1
The type for 1D sizes.
type m
= float
The type for matrices representing linear transformations of 1D space.
Constructors, accessors and constants
val empty : box1
empty
is the empty box.
val ox : box1 -> float
ox b
iso b
.
val w : box1 -> float
w b
issize 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 containsp
andp'
.
Functions
val min : box1 -> float
min b
is the smallest point ofb
(its origin).- raises Invalid_argument
on
empty
val minx : box1 -> float
minx b
ismin b
.
val max : box1 -> float
max b
is the greatest point ofb
(its size added to the origin).- raises Invalid_argument
on
empty
val maxx : box1 -> float
maxx b
ismax b
.
val midx : box1 -> float
midx b
ismid b
.
val left : box1 -> float
left b
isminx b
.
val right : box1 -> float
right b
ismaxx b
.
val area : box1 -> float
area b
is the surface area ofb
.
val inter : box1 -> box1 -> box1
inter b b'
is a box whose space is the intersection of S(b
) and S(b'
).
val inset : float -> box1 -> box1
inset d b
isb
whose edges are inset in each dimension according to amounts ind
. Negative values ind
outset. If the resulting size is negative returnsempty
. Returnsempty
onempty
.
val round : box1 -> box1
round b
is the smallest box containingb
with integer valued corners. Returnsempty
onempty
.
val ltr : float -> box1 -> box1
ltr m b
is the smallest box containing the corners ofb
transformed bym
. Returnsempty
onempty
.
Predicates and comparisons
val is_pt : box1 -> bool
is_pt b
istrue
iffb
is notempty
and its size is equal to 0 in every dimension.
val mem : float -> box1 -> bool
mem p b
istrue
iffp
is in S(b
).
Printers
val pp : Stdlib.Format.formatter -> box1 -> unit
pp ppf b
prints a textual representation ofb
onppf
.
val pp_f : (Stdlib.Format.formatter -> float -> unit) -> Stdlib.Format.formatter -> box1 -> unit
pp_f pp_fl ppf b
printsb
likepp
but usespp_fl
to print floating point values.