A VectorBoundingBox2d is a version of a BoundingBox2d that contains
vectors instead of points. All functions behave like their BoundingBox2d
counterparts; see the BoundingBox2d docs and examples for
details.
Construct a zero-width bounding box containing a single vector.
Construct a bounding box from separate X and Y intervals.
Construct a bounding box from a pair of X and Y intervals.
Given a point and a bounding box, compute the vector bounding box containing all possible vectors from that point to any point in the bounding box.
Given two bounding boxes, compute the vector bounding box containing all possible vectors from a point in the first box to a point in the second box.
Functions for building bounding boxes containing several vectors.
Construct a bounding box containing the two vectors.
Build a bounding box that contains all three of the given vectors;
VectorBoundingBox2d.hull3 v1 v2 v3is equivalent to
VectorBoundingBox2d.hull v1 [ v2, v3 ]but is more efficient.
Find the bounding box containing one or more input vectors:
VectorBoundingBox2d.hull v1 [ v2, v3, v4 ]See also hullN.
Construct a bounding box containing all N vectors in the given list. If the
list is empty, returns Nothing. If you know you have at least one point, you
can use hull instead.
Like hull, but lets you work on any kind of item as long as a
vector can be extracted from it.
Functions for combining several bounding boxes into one bounding box that contains all of the input boxes.
Build a bounding box that contains both given bounding boxes.
Build a bounding box that contains all three of the given bounding boxes;
VectorBoundingBox2d.aggregate3 b1 b2 b3is equivalent to
VectorBoundingBox2d.aggregate b1 [ b2, b3 ]but is more efficient.
Find the bounding box containing one or more input boxes; works much like
hull. See also aggregateN.
Construct a bounding box containing all bounding boxes in the given list. If
the list is empty, returns Nothing. If you know you have at least one bounding
box, you can use aggregate instead.
Like aggregate, but lets you work on any kind of item as
long as a bounding box can be extracted from it.
Combination of aggregateOf and aggregateN.
Get the range of X values contained by a bounding box.
Get the range of Y values contained by a bounding box.
Convert a bounding box to a pair of X and Y intervals.
Get the range of lengths of vectors contained in a given bounding box.
Check if a bounding box contains a particular point.
Test if the second given bounding box is fully contained within the first (is a subset of it).
Test if two boxes touch or overlap at all (have any points in common);
VectorBoundingBox2d.intersects firstBox secondBoxis equivalent to
VectorBoundingBox2d.intersection firstBox secondBox
/= Nothingbut is more efficient.
Attempt to build a bounding box that contains all vectors common to both
given bounding boxes. If the given boxes do not intersect, returns Nothing.
If two boxes just touch along an edge or at a corner, they are still considered to have an intersection, even though that intersection will have zero area (at least one of its dimensions will be zero).
Expand the given bounding box in all directions by the given offset. Negative offsets will be treated as positive (the absolute value will be used), so the resulting box will always be at least as large as the original.
Interpolate within a bounding box based on parameter values which range from 0 to 1.
Convert a bounding box from one units type to another, by providing a conversion factor given as a rate of change of destination units with respect to source units.
Convert a bounding box from one units type to another, by providing an 'inverse' conversion factor given as a rate of change of source units with respect to destination units.
Multiply (scale) a bounding box by the given value.
Divide a bounding box by the given value.
Equivalent to multiplyBy 0.5 but shorter and slightly faster.
Equivalent to multiplyBy 2 but shorter and slightly faster.
Add a vector to a bounding box.
Add two bounding boxes together.
Subtract a vector from a bounding box. Note the argument order; to compute
box - vector you would write
box |> VectorBoundingBox2d.minus vectorwhich is equivalent to
VectorBoundingBox2d.minus vector boxSubtract a bounding box from a vector (the opposite of minus).
To compute vector - box you would write
VectorBoundingBox2d.difference vector boxSubtract one bounding box from another. Note the argument order; to compute
firstBox - secondBox you would write
firstBox
|> VectorBoundingBox2d.minusBoundingBox secondBoxwhich is equivalent to
VectorBoundingBox2d.minusBoundingBox secondBox firstBoxMultiply a vector bounding box by a scalar quantity, resulting in a vector
bounding box with units Product vectorUnits scalarUnits. (To the compiler
Product a b and Product b a are different unit types, so sometimes you will
have to swap from product to times or vice versa to make the types work
out.)
Multiply a scalar quantity and a vector bounding box, resulting in a vector
bounding box with units Product scalarUnits vectorUnits.
Multiply a vector bounding box by a unitless quantity, leaving the units unchanged.
Multiply a vector bounding box by an interval, resulting in a vector
bounding box with units Product vectorUnits scalarUnits.
Multiply an interval and a vector bounding box, resulting in a vector
bounding box with units Product scalarUnits vectorUnits.
Multiply a vector bounding box by a unitless interval, leaving the units unchanged.
Create a random generator for vectors within a given bounding box.