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
- intersectVector :: Point -> Point -> Point -> Point -> Maybe Point
- turnToVector :: Point -> Radians -> Point -> Point
- originPoint :: Point
- class Translate a where
- class Coord a => Vector2D a where
- class ToPoint a where
- class ToPolarCoord a where
- class RotateLeftAround a where
Documentation
data PolarCoord Source #
class ExtremaCoord a where Source #
degreesToRadians :: Angle -> Radians Source #
radiansToDegrees :: Radians -> Angle Source #
lengthToPoint :: 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
originPoint :: Point Source #
class ToPolarCoord a where Source #
toPolarCoord :: a -> PolarCoord Source #
class RotateLeftAround a where Source #
rotateLeftAround :: Point -> Angle -> a -> a Source #