AC-Vector-Fancy-2.1.0: Fancy type system stuff for AC-VectorSource codeContentsIndex
Data.BoundingBox
Contents
Class
Types
1 dimension
2 dimensions
3 dimensions
4 dimensions
Description
Bounding boxes of various numbers of dimensions, plus a class for generically handling them.
Synopsis
class BoundingBox b where
type Point b :: *
bounds :: Point b -> Point b -> b
min_bound :: b -> Point b
max_bound :: b -> Point b
within_bounds :: Point b -> b -> Bool
union :: b -> b -> b
isect :: b -> b -> Maybe b
data Range
data BBox1
data BBox2
data BBox3
data BBox4
Class
class BoundingBox b whereSource
Class for dealing with bounding boxes.
Associated Types
type Point b :: *Source
The type of vectors that this bounding box deals with.
Methods
bounds :: Point b -> Point b -> bSource
Given two corner points, construct a bounding box containing them both. (You can use any two points, given in any order, provided that they are from opposite corners.)
min_bound :: b -> Point bSource
Return a point containing the minimum values for all coordinates.
max_bound :: b -> Point bSource
Return a point containing the maximum values for all coordinates.
within_bounds :: Point b -> b -> BoolSource
Test whether a given point lies within a given bounding box.
union :: b -> b -> bSource
Take the union of two bounding boxes. The result is a new bounding box that contains every point that the original pair of boxes contained, and probably some extra space as well.
isect :: b -> b -> Maybe bSource
Take the intersection of two bounding boxes. If the boxes do not overlap, return Nothing. Otherwise return a bounding box containing only the points common to both original bounding boxes.
show/hide Instances
Types
1 dimension
data Range Source
A Range represents a continuous interval between two Scalar endpoints.
show/hide Instances
data BBox1 Source
The BBox1 type is basically a Range, but all the operations over it work with Vector1 (which is really Scalar). While it's called a bounding box, a 1-dimensional box is in truth a simple line interval, just like Range.
show/hide Instances
2 dimensions
data BBox2 Source
A BBox2 is a 2D bounding box (aligned to the coordinate axies).
show/hide Instances
3 dimensions
data BBox3 Source
A BBox3 is a 3D bounding box (aligned to the coordinate axies).
show/hide Instances
4 dimensions
data BBox4 Source
A BBox4 is a 4D bounding box (aligned to the coordinate axies).
show/hide Instances
Produced by Haddock version 2.6.1