Copyright | (C) Frank Staals |
---|---|
License | see the LICENSE file |
Maintainer | Frank Staals |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
HGeometry.Box.Sides
Description
Synopsis
- data Sides a = Sides !a !a !a !a
- north :: Lens' (Sides a) a
- east :: Lens' (Sides a) a
- south :: Lens' (Sides a) a
- west :: Lens' (Sides a) a
- topSide :: (Num r, Rectangle_ rectangle point, Point_ point 2 r) => rectangle -> ClosedLineSegment point
- bottomSide :: (Num r, Rectangle_ rectangle point, Point_ point 2 r) => rectangle -> ClosedLineSegment point
- leftSide :: (Num r, Rectangle_ rectangle point, Point_ point 2 r) => rectangle -> ClosedLineSegment point
- rightSide :: (Num r, Rectangle_ rectangle point, Point_ point 2 r) => rectangle -> ClosedLineSegment point
- sides :: (Num r, Rectangle_ rectangle point, Point_ point 2 r) => rectangle -> Sides (ClosedLineSegment point)
- sides' :: (Num r, Rectangle_ rectangle point, Point_ point 2 r) => rectangle -> Sides (ClosedLineSegment point)
- sideDirections :: Sides CardinalDirection
- sideValues :: (Rectangle_ rectangle point, Point_ point 2 r) => rectangle -> Sides r
Documentation
The four sides of a rectangle
Constructors
Sides !a !a !a !a |
Instances
topSide :: (Num r, Rectangle_ rectangle point, Point_ point 2 r) => rectangle -> ClosedLineSegment point Source #
The top side of the box, from left to right.
bottomSide :: (Num r, Rectangle_ rectangle point, Point_ point 2 r) => rectangle -> ClosedLineSegment point Source #
Oriented from *left to right*
leftSide :: (Num r, Rectangle_ rectangle point, Point_ point 2 r) => rectangle -> ClosedLineSegment point Source #
Left side of the box, from bottom to top
rightSide :: (Num r, Rectangle_ rectangle point, Point_ point 2 r) => rectangle -> ClosedLineSegment point Source #
The right side, oriented from *bottom* to top
sides :: (Num r, Rectangle_ rectangle point, Point_ point 2 r) => rectangle -> Sides (ClosedLineSegment point) Source #
The sides of the rectangle, in order (Top, Right, Bottom, Left). The sides
themselves are also oriented in clockwise order. If, you want them in the
same order as the functions topSide
, bottomSide
, leftSide
, and
rightSide
, use sides'
instead.
sides' :: (Num r, Rectangle_ rectangle point, Point_ point 2 r) => rectangle -> Sides (ClosedLineSegment point) Source #
The sides of the rectangle. The order of the segments is (Top, Right,
Bottom, Left). Note that the segments themselves, are oriented as described
by the functions topSide, bottomSide, leftSide, rightSide (basically: from
left to right, and from bottom to top). If you want the segments oriented
along the boundary of the rectangle, use the sides
function instead.
sideDirections :: Sides CardinalDirection Source #
Constructs a Sides value that indicates the appropriate direction.
sideValues :: (Rectangle_ rectangle point, Point_ point 2 r) => rectangle -> Sides r Source #
The side values of the rectangle, i.e. the coordinates of the top, right, bottom, and left sides.