sifflet-lib-1.0: Library of modules shared by sifflet and its tests and its exporters.Source codeContentsIndex
Sifflet.Data.Geometry
Synopsis
data Position = Position {
posX :: Double
posY :: Double
}
positionDelta :: Position -> Position -> (Double, Double)
positionDistance :: Position -> Position -> Double
positionDistanceSquared :: Position -> Position -> Double
positionCloseEnough :: Position -> Position -> Double -> Bool
data Circle = Circle {
circleCenter :: Position
circleRadius :: Double
}
pointInCircle :: Position -> Circle -> Bool
data Size = Size {
sizeW :: Double
sizeH :: Double
}
data BBox = BBox Double Double Double Double
bbX :: BBox -> Double
bbY :: BBox -> Double
bbWidth :: BBox -> Double
bbSetWidth :: BBox -> Double -> BBox
bbHeight :: BBox -> Double
bbPosition :: BBox -> Position
bbSize :: BBox -> Size
bbToRect :: BBox -> Rectangle
bbFromRect :: Rectangle -> BBox
bbCenter :: BBox -> Position
bbLeft :: BBox -> Double
bbXCenter :: BBox -> Double
bbRight :: BBox -> Double
bbTop :: BBox -> Double
bbYCenter :: BBox -> Double
bbBottom :: BBox -> Double
bbMerge :: BBox -> BBox -> BBox
bbMergeList :: [BBox] -> BBox
pointInBB :: Position -> BBox -> Bool
class Widen a where
widen :: a -> Double -> a
class Translate a where
translate :: Double -> Double -> a -> a
Documentation
data Position Source
Constructors
Position
posX :: Double
posY :: Double
show/hide Instances
positionDelta :: Position -> Position -> (Double, Double)Source
positionDistance :: Position -> Position -> DoubleSource
positionDistanceSquared :: Position -> Position -> DoubleSource
positionCloseEnough :: Position -> Position -> Double -> BoolSource
data Circle Source
Constructors
Circle
circleCenter :: Position
circleRadius :: Double
show/hide Instances
pointInCircle :: Position -> Circle -> BoolSource
data Size Source
Constructors
Size
sizeW :: Double
sizeH :: Double
show/hide Instances
data BBox Source
BBox x y width height; (x, y) is the top left corner
Constructors
BBox Double Double Double Double
show/hide Instances
bbX :: BBox -> DoubleSource
bbY :: BBox -> DoubleSource
BBox accessors and utilities
bbWidth :: BBox -> DoubleSource
bbSetWidth :: BBox -> Double -> BBoxSource
bbHeight :: BBox -> DoubleSource
bbPosition :: BBox -> PositionSource
bbSize :: BBox -> SizeSource
bbToRect :: BBox -> RectangleSource
bbFromRect :: Rectangle -> BBoxSource
bbCenter :: BBox -> PositionSource
bbLeft :: BBox -> DoubleSource
bbXCenter :: BBox -> DoubleSource
bbRight :: BBox -> DoubleSource
bbTop :: BBox -> DoubleSource
bbYCenter :: BBox -> DoubleSource
bbBottom :: BBox -> DoubleSource
bbMerge :: BBox -> BBox -> BBoxSource
Form a new BBox which encloses two bboxes
bbMergeList :: [BBox] -> BBoxSource
pointInBB :: Position -> BBox -> BoolSource
class Widen a whereSource
Methods
widen :: a -> Double -> aSource
Make an object have at least a specified minimum width; does nothing if it's already at least that wide
show/hide Instances
class Translate a whereSource
A Translate is a thing that can be repositioned by delta x and delta y
Methods
translateSource
:: Doubledelta X
-> Doubledelta Y
-> athing in old position
-> athing in new position
show/hide Instances
Produced by Haddock version 2.6.1