Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- type Angle = Float
- type Radians = Float
- type Length = Float
- type X = Float
- type Y = Float
- type Offset = (X, Y)
- data PolarCoord = PolarCoord (Length, Radians)
- data Point = Point (X, Y)
- class Coord a where
- class ExtremaCoord a where
- degreesToRadians :: Angle -> Radians
- radiansToDegrees :: Radians -> Angle
- lengthToPoint :: Point -> Length
- lengthBetweenPoints :: Point -> Point -> Length
- differenceBetweenPoints :: Point -> Point -> (X, Y)
- averagePoint :: [Point] -> Point
- downPerpendicular :: Point -> Point -> Point
- upPerpendicular :: Point -> Point -> Point
- followVector :: Float -> Point -> Point -> Point
- originPoint :: Point
- class Translate a where
- class Coord a => Vector2D a where
- class ToPoint a where
- class ToPolarCoord a where
- toPolarCoord :: a -> PolarCoord
- class RotateLeftAround a where
- rotateLeftAround :: Point -> Angle -> a -> a
Documentation
data PolarCoord Source
class ExtremaCoord a where Source
degreesToRadians :: Angle -> Radians Source
radiansToDegrees :: Radians -> Angle Source
lengthToPoint :: Point -> Length Source
lengthBetweenPoints :: Point -> Point -> Length Source
averagePoint :: [Point] -> Point Source
downPerpendicular :: Point -> Point -> Point Source
Returns the vector perpendicular on the given vector between the 2 points. Always has positive y and vector length 1; y is inverted in canvas
upPerpendicular :: Point -> Point -> Point Source
Returns the vector perpendicular on the given vector between the 2 points. Always has negative y and vector length 1; y is inverted in canvas
class RotateLeftAround a where Source
rotateLeftAround :: Point -> Angle -> a -> a Source