AC-Vector-2.4.0: Efficient geometric vectors and transformations.
Safe HaskellSafe-Inferred
LanguageHaskell2010

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

Instances

Instances details
Show BBox1 Source # 
Instance details

Defined in Data.BoundingBox.B1

Methods

showsPrec :: Int -> BBox1 -> ShowS #

show :: BBox1 -> String #

showList :: [BBox1] -> ShowS #

Eq BBox1 Source # 
Instance details

Defined in Data.BoundingBox.B1

Methods

(==) :: BBox1 -> BBox1 -> Bool #

(/=) :: BBox1 -> BBox1 -> Bool #

bound_corners :: Vector1 -> Vector1 -> BBox1 Source #

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

bound_points :: [Vector1] -> BBox1 Source #

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

within_bounds :: Vector1 -> BBox1 -> Bool Source #

Test whether a Vector1 lies within a BBox1.

min_point :: BBox1 -> Vector1 Source #

Return the minimum endpoint for a BBox1.

max_point :: BBox1 -> Vector1 Source #

Return the maximum endpoint for a BBox1.

union :: BBox1 -> BBox1 -> BBox1 Source #

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 BBox1 Source #

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] -> BBox1 Source #

Efficiently compute the union of a list of bounding boxes.