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

Data.BoundingBox.B4

Description

This module provides the BBox4 type for 4-dimensional bounding boxes (bounding hyper-volumes).

Synopsis

Documentation

data BBox4 Source #

A BBox4 is a 4D bounding box (aligned to the coordinate axies).

Constructors

BBox4 

Fields

Instances

Instances details
Show BBox4 Source # 
Instance details

Defined in Data.BoundingBox.B4

Methods

showsPrec :: Int -> BBox4 -> ShowS #

show :: BBox4 -> String #

showList :: [BBox4] -> ShowS #

Eq BBox4 Source # 
Instance details

Defined in Data.BoundingBox.B4

Methods

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

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

rangeX :: BBox4 -> Range Source #

Return the X-range that this bounding box covers.

rangeY :: BBox4 -> Range Source #

Return the Y-range that this bounding box covers.

rangeZ :: BBox4 -> Range Source #

Return the Z-range that this bounding box covers.

rangeW :: BBox4 -> Range Source #

Return the W-range (4th coordinate) that this bounding box covers.

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.

min_point :: BBox4 -> Vector4 Source #

Return the minimum values for all coordinates.

max_point :: BBox4 -> Vector4 Source #

Return the maximum values for all coordinates.

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.

isect :: BBox4 -> BBox4 -> Maybe BBox4 Source #

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

unions :: [BBox4] -> BBox4 Source #

Efficiently compute the union of a list of bounding boxes.