Safe Haskell | None |
---|---|
Language | Haskell2010 |
NumHask.Rect
- newtype Rect a = Rect {}
- rect :: Iso' (V4 a) (Rect a)
- corners :: Rect a -> [V2 a]
- midRect :: BoundedField a => Rect a -> V2 a
- elementRect :: Ord a => V2 a -> Rect a -> Bool
- singletonRect :: V2 a -> Rect a
- singularRect :: Eq a => Rect a -> Bool
- intersectionRect :: Ord a => Rect a -> Rect a -> Rect a
- containsRect :: Ord a => Rect a -> Rect a -> Bool
- rangeR2s :: (BoundedField a, Traversable g, Traversable f, R2 r, Ord a) => g (f (r a)) -> Rect a
- scaleR2s :: (R2 r, BoundedField a, Traversable f, Traversable g, Ord a) => Rect a -> g (f (r a)) -> g (f (r a))
- rangeRects :: (Ord a, BoundedField a, Traversable f) => f (Rect a) -> Rect a
- projectRect :: Field a => Rect a -> Rect a -> Rect a -> Rect a
- scaleRects :: (BoundedField a, Traversable f, Ord a) => Rect a -> f (Rect a) -> f (Rect a)
- scaleRectss :: (BoundedField a, Traversable f, Traversable g, Ord a) => Rect a -> g (f (Rect a)) -> g (f (Rect a))
- gridP :: (Field a, FromInteger a) => LinearPos -> Rect a -> V2 Int -> [V2 a]
- grid :: (BoundedField a, FromInteger a) => Rect a -> V2 Int -> [Rect a]
Documentation
a two-dimensional plane, bounded by ranges.
Instances
rect :: Iso' (V4 a) (Rect a) Source #
an alternative specification; as a 4-dim vector `V4 x y z w` where: - (x,y) is the lower left corner of a rectangle, and - (z,w) is the upper right corner of a rectangle
elementRect :: Ord a => V2 a -> Rect a -> Bool Source #
determine whether a point is within the range
singletonRect :: V2 a -> Rect a Source #
rangeR2s :: (BoundedField a, Traversable g, Traversable f, R2 r, Ord a) => g (f (r a)) -> Rect a Source #
range specialized to double traversables
scaleR2s :: (R2 r, BoundedField a, Traversable f, Traversable g, Ord a) => Rect a -> g (f (r a)) -> g (f (r a)) Source #
project a double container of r2s from the current Rect range
rangeRects :: (Ord a, BoundedField a, Traversable f) => f (Rect a) -> Rect a Source #
the range Rect of a container of Rects
projectRect :: Field a => Rect a -> Rect a -> Rect a -> Rect a Source #
project a Rect from an old Rect range to a new one
scaleRects :: (BoundedField a, Traversable f, Ord a) => Rect a -> f (Rect a) -> f (Rect a) Source #
scale a double container of Rects from the current range
scaleRectss :: (BoundedField a, Traversable f, Traversable g, Ord a) => Rect a -> g (f (Rect a)) -> g (f (Rect a)) Source #
scale a double container of Rects from the current range
gridP :: (Field a, FromInteger a) => LinearPos -> Rect a -> V2 Int -> [V2 a] Source #
grid points on a rectange, divided up by a V2 Int
grid :: (BoundedField a, FromInteger a) => Rect a -> V2 Int -> [Rect a] Source #
a rectangle divided up by a V2 Int, making a list of smaller rectangles