Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module provides the BBox4
type for 4-dimensional bounding boxes (bounding hyper-volumes).
Synopsis
- data BBox4 = BBox4 {}
- rangeX :: BBox4 -> Range
- rangeY :: BBox4 -> Range
- rangeZ :: BBox4 -> Range
- rangeW :: BBox4 -> Range
- rangeXYZW :: Range -> Range -> Range -> Range -> BBox4
- bound_corners :: Vector4 -> Vector4 -> BBox4
- bound_points :: [Vector4] -> BBox4
- within_bounds :: Vector4 -> BBox4 -> Bool
- min_point :: BBox4 -> Vector4
- max_point :: BBox4 -> Vector4
- union :: BBox4 -> BBox4 -> BBox4
- isect :: BBox4 -> BBox4 -> Maybe BBox4
- unions :: [BBox4] -> BBox4
Documentation
A BBox4
is a 4D bounding box (aligned to the coordinate axies).
rangeXYZW :: Range -> Range -> Range -> Range -> BBox4 Source #
Given ranges for each coordinate axis, construct a bounding box.
bound_corners :: Vector4 -> Vector4 -> BBox4 Source #
Given a pair of corner points, construct a bounding box. (The points must be from opposite corners, but it doesn't matter which corners nor which order they are given in.)
bound_points :: [Vector4] -> BBox4 Source #
Find the bounds of a list of points. (Throws an exception if the list is empty.)
within_bounds :: Vector4 -> BBox4 -> Bool Source #
Test whether a given 4D vector is inside this bounding box.
union :: BBox4 -> BBox4 -> BBox4 Source #
Take the union of two bounding boxes. The result is a new bounding box that contains all the points the original boxes contained, plus any extra space between them.