linear-0.4.1: Linear Algebra

Safe HaskellSafe-Inferred




data V2 a Source

A 2-dimensional vector


V2 a a 


Monad V2 
Functor V2 
Typeable1 V2 
Applicative V2 
Foldable V2 
Traversable V2 
Distributive V2 
Representable V2 
Metric V2 
R2 V2 
Eq a => Eq (V2 a) 
(Num (V2 a), Fractional a) => Fractional (V2 a) 
(Typeable (V2 a), Data a) => Data (V2 a) 
Num a => Num (V2 a) 
(Eq (V2 a), Ord a) => Ord (V2 a) 
Read a => Read (V2 a) 
Show a => Show (V2 a) 
Storable a => Storable (V2 a) 
(Num (V2 a), Epsilon a) => Epsilon (V2 a) 

class R2 t whereSource

A space that distinguishes 2 orthogonal basis vectors _x and _y, but may have more.


_x :: Functor f => (a -> f a) -> t a -> f (t a)Source

_y :: Functor f => (a -> f a) -> t a -> f (t a)Source

_xy :: Functor f => (V2 a -> f (V2 a)) -> t a -> f (t a)Source


R2 V2 
R2 V3 
R2 V4 

perp :: Num a => V2 a -> V2 aSource

the counter-clockwise perpendicular vector