Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- 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
- (|+|) :: a -> a -> a
- (|-|) :: a -> a -> a
- (|/) :: Real b => a -> b -> a
- (|*) :: Real b => a -> b -> a
- negateVector :: a -> a
- angleBetween :: a -> a -> Radians
- class ToPoint a where
- class ToPolarCoord a where
- toPolarCoord :: a -> PolarCoord
- class RotateLeftAround a where
- rotateLeftAround :: Point -> Angle -> a -> a
Documentation
data PolarCoord Source #
Instances
Instances
Eq Point Source # | |
Show Point Source # | |
Generic Point Source # | |
NFData Point Source # | |
Defined in Eventloop.Utility.Vectors | |
FromJSON Point | |
Defined in Eventloop.Module.Websocket.Mouse.Mouse parseJSON :: Value -> Parser Point parseJSONList :: Value -> Parser [Point] | |
RotateLeftAround Point Source # | |
Defined in Eventloop.Utility.Vectors | |
ToPolarCoord Point Source # | |
Defined in Eventloop.Utility.Vectors toPolarCoord :: Point -> PolarCoord Source # | |
Vector2D Point Source # | |
Defined in Eventloop.Utility.Vectors | |
Coord Point Source # | |
ExtremaCoord [Point] Source # | |
type Rep Point Source # | |
class ExtremaCoord a where Source #
Instances
ExtremaCoord BoundingBox Source # | |
Defined in Eventloop.Module.BasicShapes.Classes xMin :: BoundingBox -> X Source # xMax :: BoundingBox -> X Source # yMin :: BoundingBox -> Y Source # yMax :: BoundingBox -> Y Source # | |
ExtremaCoord GeometricPrimitive Source # | |
Defined in Eventloop.Module.BasicShapes.Classes xMin :: GeometricPrimitive -> X Source # xMax :: GeometricPrimitive -> X Source # yMin :: GeometricPrimitive -> Y Source # yMax :: GeometricPrimitive -> Y Source # | |
ExtremaCoord [Point] 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 Translate a where Source #
Instances
Translate Shape Source # | |
Translate GeometricPrimitive Source # | |
Defined in Eventloop.Module.BasicShapes.Classes |
class Coord a => Vector2D a where Source #
(|/) :: Real b => a -> b -> a Source #
(|*) :: Real b => a -> b -> a Source #
negateVector :: a -> a Source #
angleBetween :: a -> a -> Radians Source #
Instances
Vector2D Point Source # | |
Defined in Eventloop.Utility.Vectors | |
Vector2D PolarCoord Source # | |
Defined in Eventloop.Utility.Vectors (|+|) :: PolarCoord -> PolarCoord -> PolarCoord Source # (|-|) :: PolarCoord -> PolarCoord -> PolarCoord Source # (|/) :: Real b => PolarCoord -> b -> PolarCoord Source # (|*) :: Real b => PolarCoord -> b -> PolarCoord Source # negateVector :: PolarCoord -> PolarCoord Source # angleBetween :: PolarCoord -> PolarCoord -> Radians Source # |
class ToPoint a where Source #
Instances
ToPoint PolarCoord Source # | |
Defined in Eventloop.Utility.Vectors toPoint :: PolarCoord -> Point Source # |
class ToPolarCoord a where Source #
toPolarCoord :: a -> PolarCoord Source #
Instances
ToPolarCoord Point Source # | |
Defined in Eventloop.Utility.Vectors toPolarCoord :: Point -> PolarCoord Source # |
class RotateLeftAround a where Source #
rotateLeftAround :: Point -> Angle -> a -> a Source #
Instances
RotateLeftAround Point Source # | |
Defined in Eventloop.Utility.Vectors | |
RotateLeftAround PolarCoord Source # | |
Defined in Eventloop.Utility.Vectors rotateLeftAround :: Point -> Angle -> PolarCoord -> PolarCoord Source # | |
RotateLeftAround BoundingBox Source # | |
Defined in Eventloop.Module.BasicShapes.Classes rotateLeftAround :: Point -> Angle -> BoundingBox -> BoundingBox Source # | |
RotateLeftAround GeometricPrimitive Source # | |
Defined in Eventloop.Module.BasicShapes.Classes rotateLeftAround :: Point -> Angle -> GeometricPrimitive -> GeometricPrimitive Source # |