Safe Haskell | Safe-Inferred |
---|
- 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 -> ExtentSource
A square extent of a given size.
sizeOfExtent :: Extent -> (Int, Int)Source
Get the width and height of an extent.
isUnitExtent :: Extent -> BoolSource
Check if an extent is a square with a width and height of 1.
coordInExtent :: Extent -> Coord -> BoolSource
Check whether a coordinate lies inside an extent.
pointInExtent :: Extent -> Point -> BoolSource
Check whether a point lies inside an extent.
centerCoordOfExtent :: Extent -> (Int, Int)Source
Get the coordinate that lies at the center of an extent.
cutQuadOfExtent :: Quad -> Extent -> ExtentSource
Cut one quadrant out of an extent.
quadOfCoord :: Extent -> Coord -> Maybe QuadSource
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.