Copyright | (C) 2012-2015 Edward Kmett |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Linear.V3
Description
3-D Vectors
Synopsis
- data V3 a = V3 !a !a !a
- cross :: Num a => V3 a -> V3 a -> V3 a
- triple :: Num a => V3 a -> V3 a -> V3 a -> a
- class R1 t where
- _x :: Lens' (t a) a
- class R1 t => R2 t where
- _yx :: R2 t => Lens' (t a) (V2 a)
- class R2 t => R3 t where
- _xz :: R3 t => Lens' (t a) (V2 a)
- _yz :: R3 t => Lens' (t a) (V2 a)
- _zx :: R3 t => Lens' (t a) (V2 a)
- _zy :: R3 t => Lens' (t a) (V2 a)
- _xzy :: R3 t => Lens' (t a) (V3 a)
- _yxz :: R3 t => Lens' (t a) (V3 a)
- _yzx :: R3 t => Lens' (t a) (V3 a)
- _zxy :: R3 t => Lens' (t a) (V3 a)
- _zyx :: R3 t => Lens' (t a) (V3 a)
- ex :: R1 t => E t
- ey :: R2 t => E t
- ez :: R3 t => E t
Documentation
A 3-dimensional vector
Constructors
V3 !a !a !a |
Instances
Monad V3 Source # | |
Functor V3 Source # | |
MonadFix V3 Source # | |
Applicative V3 Source # | |
Foldable V3 Source # | |
Defined in Linear.V3 Methods foldMap :: Monoid m => (a -> m) -> V3 a -> m foldMap' :: Monoid m => (a -> m) -> V3 a -> m foldr :: (a -> b -> b) -> b -> V3 a -> b foldr' :: (a -> b -> b) -> b -> V3 a -> b foldl :: (b -> a -> b) -> b -> V3 a -> b foldl' :: (b -> a -> b) -> b -> V3 a -> b foldr1 :: (a -> a -> a) -> V3 a -> a foldl1 :: (a -> a -> a) -> V3 a -> a | |
Traversable V3 Source # | |
Show1 V3 Source # | |
Defined in Linear.V3 Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> V3 a -> ShowS liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [V3 a] -> ShowS | |
Read1 V3 Source # | |
Defined in Linear.V3 Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (V3 a) liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [V3 a] liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (V3 a) liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [V3 a] | |
Ord1 V3 Source # | |
Defined in Linear.V3 Methods liftCompare :: (a -> b -> Ordering) -> V3 a -> V3 b -> Ordering | |
Eq1 V3 Source # | |
MonadZip V3 Source # | |
Traversable1 V3 Source # | |
Hashable1 V3 Source # | |
Defined in Linear.V3 Methods liftHashWithSalt :: (Int -> a -> Int) -> Int -> V3 a -> Int | |
Additive V3 Source # | |
Defined in Linear.V3 | |
Apply V3 Source # | |
Distributive V3 Source # | |
Bind V3 Source # | |
Metric V3 Source # | |
Serial1 V3 Source # | |
Defined in Linear.V3 Methods serializeWith :: MonadPut m => (a -> m ()) -> V3 a -> m () deserializeWith :: MonadGet m => m a -> m (V3 a) | |
Representable V3 Source # | |
Foldable1 V3 Source # | |
Finite V3 Source # | |
R1 V3 Source # | |
R2 V3 Source # | |
R3 V3 Source # | |
Trace V3 Source # | |
Affine V3 Source # | |
Unbox a => Vector Vector (V3 a) Source # | |
Defined in Linear.V3 Methods basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (V3 a) -> m (Vector (V3 a)) Source # basicUnsafeThaw :: PrimMonad m => Vector (V3 a) -> m (Mutable Vector (PrimState m) (V3 a)) Source # basicLength :: Vector (V3 a) -> Int Source # basicUnsafeSlice :: Int -> Int -> Vector (V3 a) -> Vector (V3 a) Source # basicUnsafeIndexM :: Monad m => Vector (V3 a) -> Int -> m (V3 a) Source # basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (V3 a) -> Vector (V3 a) -> m () Source # | |
Unbox a => MVector MVector (V3 a) Source # | |
Defined in Linear.V3 Methods basicLength :: MVector s (V3 a) -> Int Source # basicUnsafeSlice :: Int -> Int -> MVector s (V3 a) -> MVector s (V3 a) Source # basicOverlaps :: MVector s (V3 a) -> MVector s (V3 a) -> Bool Source # basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (V3 a)) Source # basicInitialize :: PrimMonad m => MVector (PrimState m) (V3 a) -> m () Source # basicUnsafeReplicate :: PrimMonad m => Int -> V3 a -> m (MVector (PrimState m) (V3 a)) Source # basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (V3 a) -> Int -> m (V3 a) Source # basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (V3 a) -> Int -> V3 a -> m () Source # basicClear :: PrimMonad m => MVector (PrimState m) (V3 a) -> m () Source # basicSet :: PrimMonad m => MVector (PrimState m) (V3 a) -> V3 a -> m () Source # basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (V3 a) -> MVector (PrimState m) (V3 a) -> m () Source # basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (V3 a) -> MVector (PrimState m) (V3 a) -> m () Source # basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (V3 a) -> Int -> m (MVector (PrimState m) (V3 a)) Source # | |
Num r => Coalgebra r (E V3) Source # | |
Bounded a => Bounded (V3 a) Source # | |
Eq a => Eq (V3 a) Source # | |
Floating a => Floating (V3 a) Source # | |
Fractional a => Fractional (V3 a) Source # | |
Data a => Data (V3 a) Source # | |
Defined in Linear.V3 Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> V3 a -> c (V3 a) gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (V3 a) dataTypeOf :: V3 a -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (V3 a)) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (V3 a)) gmapT :: (forall b. Data b => b -> b) -> V3 a -> V3 a gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> V3 a -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> V3 a -> r gmapQ :: (forall d. Data d => d -> u) -> V3 a -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> V3 a -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> V3 a -> m (V3 a) gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> V3 a -> m (V3 a) gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> V3 a -> m (V3 a) | |
Num a => Num (V3 a) Source # | |
Ord a => Ord (V3 a) Source # | |
Read a => Read (V3 a) Source # | |
Show a => Show (V3 a) Source # | |
Ix a => Ix (V3 a) Source # | |
Generic (V3 a) Source # | |
Semigroup a => Semigroup (V3 a) Source # | |
Monoid a => Monoid (V3 a) Source # | |
Lift a => Lift (V3 a) Source # | |
Storable a => Storable (V3 a) Source # | |
Defined in Linear.V3 | |
Unbox a => Unbox (V3 a) Source # | |
Defined in Linear.V3 | |
Random a => Random (V3 a) Source # | |
Binary a => Binary (V3 a) Source # | |
NFData a => NFData (V3 a) Source # | |
Epsilon a => Epsilon (V3 a) Source # | |
Ixed (V3 a) Source # | |
Hashable a => Hashable (V3 a) Source # | |
Defined in Linear.V3 | |
Serial a => Serial (V3 a) Source # | |
Defined in Linear.V3 | |
Serialize a => Serialize (V3 a) Source # | |
Generic1 V3 Source # | |
FoldableWithIndex (E V3) V3 Source # | |
Defined in Linear.V3 | |
FunctorWithIndex (E V3) V3 Source # | |
TraversableWithIndex (E V3) V3 Source # | |
Each (V3 a) (V3 b) a b Source # | |
Field1 (V3 a) (V3 a) a a Source # | |
Field2 (V3 a) (V3 a) a a Source # | |
Field3 (V3 a) (V3 a) a a Source # | |
type Rep V3 Source # | |
type Size V3 Source # | |
type Diff V3 Source # | |
Defined in Linear.Affine | |
data MVector s (V3 a) Source # | |
type Rep (V3 a) Source # | |
Defined in Linear.V3 type Rep (V3 a) = D1 ('MetaData "V3" "Linear.V3" "linear-1.21.1-ILvJ7ath0ShCdBBZlFlbTo" 'False) (C1 ('MetaCons "V3" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a)))) | |
data Vector (V3 a) Source # | |
type Index (V3 a) Source # | |
type IxValue (V3 a) Source # | |
type Rep1 V3 Source # | |
Defined in Linear.V3 type Rep1 V3 = D1 ('MetaData "V3" "Linear.V3" "linear-1.21.1-ILvJ7ath0ShCdBBZlFlbTo" 'False) (C1 ('MetaCons "V3" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1 :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1 :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1))) |
A space that has at least 1 basis vector _x
.
class R1 t => R2 t where Source #
Minimal complete definition
Methods
>>>
V2 1 2 ^._y
2
>>>
V2 1 2 & _y .~ 3
V2 1 3