| Copyright | (C) Frank Staals |
|---|---|
| License | see the LICENSE file |
| Maintainer | Frank Staals |
| Safe Haskell | None |
| Language | GHC2024 |
HGeometry.Box.Class
Description
d dimensional boxes
Synopsis
- class (HasMinPoint box point, HasMaxPoint box point, Point_ point (Dimension box) (NumType box)) => Box_ box point | box -> point where
- class HasMinPoint box point | box -> point where
- class HasMaxPoint box point | box -> point where
- centerPoint :: forall box point (d :: Nat) r. (Box_ box point, Point_ point d r, Fractional r) => box -> point
- type Rectangle_ rectangle point = (Box_ rectangle point, Dimension rectangle ~ 2)
- width :: forall box point (d :: Nat) r. (Box_ box point, Point_ point d r, 0 <= (d - 1), Functor (Vector d), Num r) => box -> r
- height :: forall box point (d :: Nat) r. (Box_ box point, Point_ point d r, 1 <= (d - 1), Functor (Vector d), Num r) => box -> r
- size :: forall box (d :: Nat) point r. (Box_ box point, Point_ point d r, Num r, Functor (Vector d)) => box -> Vector d r
Documentation
class (HasMinPoint box point, HasMaxPoint box point, Point_ point (Dimension box) (NumType box)) => Box_ box point | box -> point where Source #
d-dimensional Boxes
Methods
extent :: forall r (d :: Nat). (r ~ NumType box, d ~ Dimension box, Num r) => box -> Vector d (ClosedInterval r) Source #
Get a vector with the extent of the box in each dimension. Note that the resulting vector is 0 indexed whereas one would normally count dimensions starting at zero.
class HasMinPoint box point | box -> point where Source #
Types that have a minPoint field lens
Instances
| HasMinPoint (Box point) point Source # | |
| HasMinPoint box point => HasMinPoint (box :+ extra) point Source # | |
class HasMaxPoint box point | box -> point where Source #
Types that have a maxPoint field lens
Instances
| HasMaxPoint (Box point) point Source # | |
| HasMaxPoint box point => HasMaxPoint (box :+ extra) point Source # | |
centerPoint :: forall box point (d :: Nat) r. (Box_ box point, Point_ point d r, Fractional r) => box -> point Source #
Get the center point of a box
>>>centerPoint myRectPoint2 5.5 10.5
type Rectangle_ rectangle point = (Box_ rectangle point, Dimension rectangle ~ 2) Source #
Rectangles are two dimensional boxes.
width :: forall box point (d :: Nat) r. (Box_ box point, Point_ point d r, 0 <= (d - 1), Functor (Vector d), Num r) => box -> r Source #
Get the width of a rectangle.
height :: forall box point (d :: Nat) r. (Box_ box point, Point_ point d r, 1 <= (d - 1), Functor (Vector d), Num r) => box -> r Source #
get the height of a rectangle
size :: forall box (d :: Nat) point r. (Box_ box point, Point_ point d r, Num r, Functor (Vector d)) => box -> Vector d r Source #
Get the size of the box (in all dimensions). Note that the resulting vector is 0 indexed whereas one would normally count dimensions starting at zero.
>>>size myRectVector2 9.0 19.0