package gg
Module Gg.Box1Source
1D axis-aligned boxes.
The type for 1D boxes (closed intervals).
The type for 1D vectors.
The type for 1D points.
The type for matrices representing linear transformations of 1D space.
Constructors, accessors and constants
v_mid mid size is a box whose mid point is mid and size is size.
of_pts p p' is the smallest box whose space contains p and p'.
add_pt b p is the smallest box whose space contains b and p.
Functions
min b is the smallest point of b (its origin).
Raises Invalid_argument on empty
max b is the greatest point of b (its size added to the origin).
Raises Invalid_argument on empty
mid b is the mid point between min and max.
Raises Invalid_argument on empty
inter b b' is a box whose space is the intersection of S(b) and S(b').
union b b' is the smallest box whose space contains S(b) and S(b').
inset d b is b whose edges are inset in each dimension according to amounts in d. Negative values in d outset. If the size in dimension i becomes negative it is clamped to 0 and the ith coordinate of the mid point of b is used for the ith coordinate of the resulting box's origin. Returns empty on empty.
Predicates and comparisons
is_pt b is true iff b is not empty and its size is equal to 0 in every dimension.
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.
Formatters
pp ppf b prints a textual representation of b on ppf.
pp_f pp_fl ppf b prints b like pp but uses pp_fl to print floating point values.