Module Gg.Box1
type t= box1The type for 1D boxes (closed intervals).
val dim : intdimis the dimension of the boxes of typebox2.
type size= size1The type for 1D sizes.
type m= floatThe type for matrices representing linear transformations of 1D space.
Constructors, accessors and constants
val empty : box1emptyis the empty box.
val ox : box1 -> floatox biso b.
val w : box1 -> floatw bissize b.
val zero : box1zerois a box whose origin and size is zero.
val unit : box1unitis the unit box which extends from zero to one in all dimensions.
val of_pts : float -> float -> box1of_pts p p'is the smallest box whose space containspandp'.
Functions
val min : box1 -> floatmin bis the smallest point ofb(its origin).- raises Invalid_argument
on
empty
val minx : box1 -> floatminx bismin b.
val max : box1 -> floatmax bis the greatest point ofb(its size added to the origin).- raises Invalid_argument
on
empty
val maxx : box1 -> floatmaxx bismax b.
val midx : box1 -> floatmidx bismid b.
val left : box1 -> floatleft bisminx b.
val right : box1 -> floatright bismaxx b.
val area : box1 -> floatarea bis the surface area ofb.
val inter : box1 -> box1 -> box1inter b b'is a box whose space is the intersection of S(b) and S(b').
val inset : float -> box1 -> box1inset d bisbwhose edges are inset in each dimension according to amounts ind. Negative values indoutset. If the resulting size is negative returnsempty. Returnsemptyonempty.
val round : box1 -> box1round bis the smallest box containingbwith integer valued corners. Returnsemptyonempty.
val ltr : float -> box1 -> box1ltr m bis the smallest box containing the corners ofbtransformed bym. Returnsemptyonempty.
Predicates and comparisons
val is_pt : box1 -> boolis_pt bistrueiffbis notemptyand its size is equal to 0 in every dimension.
val mem : float -> box1 -> boolmem p bistrueiffpis in S(b).
Printers
val pp : Stdlib.Format.formatter -> box1 -> unitpp ppf bprints a textual representation ofbonppf.
val pp_f : (Stdlib.Format.formatter -> float -> unit) -> Stdlib.Format.formatter -> box1 -> unitpp_f pp_fl ppf bprintsblikeppbut usespp_flto print floating point values.