AC-Vector-2.3.2: Efficient geometric vectors and transformations.

Safe HaskellSafe-Infered

Data.BoundingBox.B1

Description

This module provides the BBox1 type (mainly for completeness).

Synopsis

Documentation

newtype 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.

Constructors

BBox1 

Fields

range :: Range
 

Instances

bound_corners :: Vector1 -> Vector1 -> BBox1Source

Given two vectors, construct a bounding box (swapping the endpoints if necessary).

bound_points :: [Vector1] -> BBox1Source

Find the bounds of a list of points. (Throws an exception if the list is empty.)

within_bounds :: Vector1 -> BBox1 -> BoolSource

Test whether a Vector1 lies within a BBox1.

min_point :: BBox1 -> Vector1Source

Return the minimum endpoint for a BBox1.

max_point :: BBox1 -> Vector1Source

Return the maximum endpoint for a BBox1.

union :: BBox1 -> BBox1 -> BBox1Source

Take the union of two BBox1 values. The result is a new BBox1 that contains all the points the original boxes contained, plus any extra space between them.

isect :: BBox1 -> BBox1 -> Maybe BBox1Source

Take the intersection of two BBox1 values. If the boxes do not overlap, return Nothing. Otherwise return a BBox1 containing only the points common to both argument boxes.

unions :: [BBox1] -> BBox1Source

Efficiently compute the union of a list of bounding boxes.