Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Extent
- type Coord = (Int, Int)
- makeExtent :: Int -> Int -> Int -> Int -> Extent
- takeExtent :: Extent -> (Int, Int, Int, Int)
- squareExtent :: Int -> Extent
- sizeOfExtent :: Extent -> (Int, Int)
- isUnitExtent :: Extent -> Bool
- coordInExtent :: Extent -> Coord -> Bool
- pointInExtent :: Extent -> Point -> Bool
- centerCoordOfExtent :: Extent -> (Int, Int)
- cutQuadOfExtent :: Quad -> Extent -> Extent
- quadOfCoord :: Extent -> Coord -> Maybe Quad
- pathToCoord :: Extent -> Coord -> Maybe [Quad]
- intersectSegExtent :: Point -> Point -> Extent -> Maybe Point
- touchesSegExtent :: Point -> Point -> Extent -> Bool
Documentation
A rectangular area of the 2D plane. We keep the type abstract to ensure that invalid extents cannot be constructed.
Construct an extent.
The north value must be > south, and east > west, else error
.
squareExtent :: Int -> Extent Source #
A square extent of a given size.
isUnitExtent :: Extent -> Bool Source #
Check if an extent is a square with a width and height of 1.
centerCoordOfExtent :: Extent -> (Int, Int) Source #
Get the coordinate that lies at the center of an extent.
quadOfCoord :: Extent -> Coord -> Maybe Quad Source #
Get the quadrant that this coordinate lies in, if any.
pathToCoord :: Extent -> Coord -> Maybe [Quad] Source #
Constuct a path to a particular coordinate in an extent.