eventloop-0.8.2.8: A different take on an IO system. Based on Amanda's IO loop, this eventloop takes a function that maps input events to output events. It can easily be extended by modules that represent IO devices or join multiple modules together.

Safe HaskellSafe
LanguageHaskell2010

Eventloop.Utility.Vectors

Synopsis

Documentation

type Angle Source #

Arguments

 = Float

In degrees

type X = Float Source #

type Y = Float Source #

type Offset = (X, Y) Source #

data Point Source #

Constructors

Point (X, Y) 
Instances
Eq Point Source # 
Instance details

Defined in Eventloop.Utility.Vectors

Methods

(==) :: Point -> Point -> Bool #

(/=) :: Point -> Point -> Bool #

Show Point Source # 
Instance details

Defined in Eventloop.Utility.Vectors

Methods

showsPrec :: Int -> Point -> ShowS #

show :: Point -> String #

showList :: [Point] -> ShowS #

Generic Point Source # 
Instance details

Defined in Eventloop.Utility.Vectors

Associated Types

type Rep Point :: Type -> Type #

Methods

from :: Point -> Rep Point x #

to :: Rep Point x -> Point #

NFData Point Source # 
Instance details

Defined in Eventloop.Utility.Vectors

Methods

rnf :: Point -> () #

FromJSON Point 
Instance details

Defined in Eventloop.Module.Websocket.Mouse.Mouse

Methods

parseJSON :: Value -> Parser Point

parseJSONList :: Value -> Parser [Point]

RotateLeftAround Point Source # 
Instance details

Defined in Eventloop.Utility.Vectors

ToPolarCoord Point Source # 
Instance details

Defined in Eventloop.Utility.Vectors

Vector2D Point Source # 
Instance details

Defined in Eventloop.Utility.Vectors

Coord Point Source # 
Instance details

Defined in Eventloop.Utility.Vectors

Methods

x :: Point -> X Source #

y :: Point -> Y Source #

ExtremaCoord [Point] Source # 
Instance details

Defined in Eventloop.Utility.Vectors

Methods

xMin :: [Point] -> X Source #

xMax :: [Point] -> X Source #

yMin :: [Point] -> Y Source #

yMax :: [Point] -> Y Source #

type Rep Point Source # 
Instance details

Defined in Eventloop.Utility.Vectors

type Rep Point = D1 (MetaData "Point" "Eventloop.Utility.Vectors" "eventloop-0.8.2.8-inplace" False) (C1 (MetaCons "Point" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (X, Y))))

class Coord a where Source #

Methods

x :: a -> X Source #

y :: a -> Y Source #

Instances
Coord Point Source # 
Instance details

Defined in Eventloop.Utility.Vectors

Methods

x :: Point -> X Source #

y :: Point -> Y Source #

Coord PolarCoord Source # 
Instance details

Defined in Eventloop.Utility.Vectors

Methods

x :: PolarCoord -> X Source #

y :: PolarCoord -> Y 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 Coord a => Vector2D a where Source #

Methods

(|+|) :: a -> a -> a Source #

(|-|) :: a -> a -> a Source #

(|/) :: Real b => a -> b -> a Source #

(|*) :: Real b => a -> b -> a Source #

negateVector :: a -> a Source #

angleBetween :: a -> a -> Radians Source #

class ToPoint a where Source #

Methods

toPoint :: a -> Point Source #

Instances
ToPoint PolarCoord Source # 
Instance details

Defined in Eventloop.Utility.Vectors

class ToPolarCoord a where Source #

Instances
ToPolarCoord Point Source # 
Instance details

Defined in Eventloop.Utility.Vectors