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

Data.BoundingBox.Range

Description

This module provides the Range type and several functions for working with ranges.

Synopsis

Documentation

data Range Source #

A Range represents a continuous interval between two Scalar endpoints.

Constructors

Range 

Instances

Instances details
Show Range Source # 
Instance details

Defined in Data.BoundingBox.Range

Methods

showsPrec :: Int -> Range -> ShowS #

show :: Range -> String #

showList :: [Range] -> ShowS #

Eq Range Source # 
Instance details

Defined in Data.BoundingBox.Range

Methods

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

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

bound_corners :: Scalar -> Scalar -> Range Source #

Given two Scalars, construct a Range (swapping the endpoints if necessary so that they are in the correct order.

bound_points :: [Scalar] -> Range Source #

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

within_bounds :: Scalar -> Range -> Bool Source #

Test whether a given Scalar falls within a particular Range.

union :: Range -> Range -> Range Source #

Take the union of two ranges. The resulting Range contains all points that the original ranges contained, plus any points between them (if the original ranges don't overlap).

isect :: Range -> Range -> Maybe Range Source #

Take the intersection of two ranges. If the ranges do not overlap, the intersection is empty, and Nothing is returned. (This is a good way to check whether two ranges overlap or not.) Otherwise a new Range is returned that contains only the points common to both ranges.

unions :: [Range] -> Range Source #

Efficiently compute the union of a list of ranges.