Safe Haskell | None |
---|---|
Language | Haskell2010 |
Adapted from Linear.V2
Documentation
Instances
Monad V2 Source # | |
Functor V2 Source # | |
Applicative V2 Source # | |
Foldable V2 Source # | |
Defined in Nonlinear.V2 fold :: Monoid m => V2 m -> m # foldMap :: Monoid m => (a -> m) -> V2 a -> m # foldMap' :: Monoid m => (a -> m) -> V2 a -> m # foldr :: (a -> b -> b) -> b -> V2 a -> b # foldr' :: (a -> b -> b) -> b -> V2 a -> b # foldl :: (b -> a -> b) -> b -> V2 a -> b # foldl' :: (b -> a -> b) -> b -> V2 a -> b # foldr1 :: (a -> a -> a) -> V2 a -> a # foldl1 :: (a -> a -> a) -> V2 a -> a # elem :: Eq a => a -> V2 a -> Bool # maximum :: Ord a => V2 a -> a # | |
Traversable V2 Source # | |
Eq1 V2 Source # | |
Ord1 V2 Source # | |
Defined in Nonlinear.V2 | |
Read1 V2 Source # | |
Show1 V2 Source # | |
Vec V2 Source # | |
R1 V2 Source # | |
Defined in Nonlinear.V2 | |
R2 V2 Source # | |
Bounded a => Bounded (V2 a) Source # | |
Eq a => Eq (V2 a) Source # | |
Floating a => Floating (V2 a) Source # | |
Fractional a => Fractional (V2 a) Source # | |
Data a => Data (V2 a) Source # | |
Defined in Nonlinear.V2 gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> V2 a -> c (V2 a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (V2 a) # dataTypeOf :: V2 a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (V2 a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (V2 a)) # gmapT :: (forall b. Data b => b -> b) -> V2 a -> V2 a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> V2 a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> V2 a -> r # gmapQ :: (forall d. Data d => d -> u) -> V2 a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> V2 a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> V2 a -> m (V2 a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> V2 a -> m (V2 a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> V2 a -> m (V2 a) # | |
Num a => Num (V2 a) Source # | |
Ord a => Ord (V2 a) Source # | |
Read a => Read (V2 a) Source # | |
Show a => Show (V2 a) Source # | |
Ix a => Ix (V2 a) Source # | |
Generic (V2 a) Source # | |
Semigroup x => Semigroup (V2 x) Source # | |
Monoid a => Monoid (V2 a) Source # | |
Storable a => Storable (V2 a) Source # | |
Generic1 V2 Source # | |
type Rep (V2 a) Source # | |
Defined in Nonlinear.V2 type Rep (V2 a) = D1 ('MetaData "V2" "Nonlinear.V2" "nonlinear-0.1.0-dd7wbAvLl3JZC37BHOks3" 'False) (C1 ('MetaCons "V2" 'PrefixI 'True) (S1 ('MetaSel ('Just "v2x") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Just "v2y") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a))) | |
type Rep1 V2 Source # | |
Defined in Nonlinear.V2 type Rep1 V2 = D1 ('MetaData "V2" "Nonlinear.V2" "nonlinear-0.1.0-dd7wbAvLl3JZC37BHOks3" 'False) (C1 ('MetaCons "V2" 'PrefixI 'True) (S1 ('MetaSel ('Just "v2x") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1 :*: S1 ('MetaSel ('Just "v2y") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1)) |
perp :: Num a => V2 a -> V2 a Source #
the counter-clockwise perpendicular vector
>>>
perp $ V2 10 20
V2 (-20) 10
crossZ :: Num a => V2 a -> V2 a -> a Source #
The Z-component of the cross product of two vectors in the XY-plane.
>>>
crossZ (V2 1 0) (V2 0 1)
1