linear-1.20.9: Linear Algebra

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 | Haskell98

Linear.Quaternion

Description

Quaternions

Synopsis

- data Quaternion a = Quaternion !a !(V3 a)
- class Complicated t where
  - _e, _i :: Lens' (t a) a
- class Complicated t => Hamiltonian t where
  - _j, _k :: Lens' (t a) a
  - _ijk :: Lens' (t a) (V3 a)
- ee :: Complicated t => E t
- ei :: Complicated t => E t
- ej :: Hamiltonian t => E t
- ek :: Hamiltonian t => E t
- slerp :: RealFloat a => Quaternion a -> Quaternion a -> a -> Quaternion a
- asinq :: RealFloat a => Quaternion a -> Quaternion a -> Quaternion a
- acosq :: RealFloat a => Quaternion a -> Quaternion a -> Quaternion a
- atanq :: RealFloat a => Quaternion a -> Quaternion a -> Quaternion a
- asinhq :: RealFloat a => Quaternion a -> Quaternion a -> Quaternion a
- acoshq :: RealFloat a => Quaternion a -> Quaternion a -> Quaternion a
- atanhq :: RealFloat a => Quaternion a -> Quaternion a -> Quaternion a
- absi :: Floating a => Quaternion a -> a
- pow :: RealFloat a => Quaternion a -> a -> Quaternion a
- rotate :: (Conjugate a, RealFloat a) => Quaternion a -> V3 a -> V3 a
- axisAngle :: (Epsilon a, Floating a) => V3 a -> a -> Quaternion a

# Documentation

data Quaternion a Source #

Quaternions

Constructors

Quaternion !a !(V3 a) |

Instances

Monad Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods (>>=) :: Quaternion a -> (a -> Quaternion b) -> Quaternion b Source # (>>) :: Quaternion a -> Quaternion b -> Quaternion b Source # return :: a -> Quaternion a Source # fail :: String -> Quaternion a Source #
Functor Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods fmap :: (a -> b) -> Quaternion a -> Quaternion b Source # (<$) :: a -> Quaternion b -> Quaternion a Source #
MonadFix Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods mfix :: (a -> Quaternion a) -> Quaternion a Source #
Applicative Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods pure :: a -> Quaternion a Source # (<*>) :: Quaternion (a -> b) -> Quaternion a -> Quaternion b Source # liftA2 :: (a -> b -> c) -> Quaternion a -> Quaternion b -> Quaternion c Source # (*>) :: Quaternion a -> Quaternion b -> Quaternion b Source # (<*) :: Quaternion a -> Quaternion b -> Quaternion a Source #
Foldable Quaternion Source # |

Instance details

Defined in Linear.Quaternion

Methods

fold :: Monoid m => Quaternion m -> m Source #

foldMap :: Monoid m => (a -> m) -> Quaternion a -> m Source #

foldr :: (a -> b -> b) -> b -> Quaternion a -> b Source #

foldr' :: (a -> b -> b) -> b -> Quaternion a -> b Source #

foldl :: (b -> a -> b) -> b -> Quaternion a -> b Source #

foldl' :: (b -> a -> b) -> b -> Quaternion a -> b Source #

foldr1 :: (a -> a -> a) -> Quaternion a -> a Source #

foldl1 :: (a -> a -> a) -> Quaternion a -> a Source #

toList :: Quaternion a -> [a] Source #

null :: Quaternion a -> Bool Source #

length :: Quaternion a -> Int Source #

elem :: Eq a => a -> Quaternion a -> Bool Source #

maximum :: Ord a => Quaternion a -> a Source #

minimum :: Ord a => Quaternion a -> a Source #

sum :: Num a => Quaternion a -> a Source #

product :: Num a => Quaternion a -> a Source #

Traversable Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods traverse :: Applicative f => (a -> f b) -> Quaternion a -> f (Quaternion b) Source # sequenceA :: Applicative f => Quaternion (f a) -> f (Quaternion a) Source # mapM :: Monad m => (a -> m b) -> Quaternion a -> m (Quaternion b) Source # sequence :: Monad m => Quaternion (m a) -> m (Quaternion a) Source #
Distributive Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods distribute :: Functor f => f (Quaternion a) -> Quaternion (f a) Source # collect :: Functor f => (a -> Quaternion b) -> f a -> Quaternion (f b) Source # distributeM :: Monad m => m (Quaternion a) -> Quaternion (m a) Source # collectM :: Monad m => (a -> Quaternion b) -> m a -> Quaternion (m b) Source #
Representable Quaternion Source # |
Instance details Defined in Linear.Quaternion Associated Types type Rep Quaternion :: Type Source # Methods tabulate :: (Rep Quaternion -> a) -> Quaternion a Source # index :: Quaternion a -> Rep Quaternion -> a Source #
Eq1 Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods liftEq :: (a -> b -> Bool) -> Quaternion a -> Quaternion b -> Bool Source #
Ord1 Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods liftCompare :: (a -> b -> Ordering) -> Quaternion a -> Quaternion b -> Ordering Source #
Read1 Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Quaternion a) Source # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Quaternion a] Source # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Quaternion a) Source # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Quaternion a] Source #
Show1 Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Quaternion a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Quaternion a] -> ShowS Source #
MonadZip Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods mzip :: Quaternion a -> Quaternion b -> Quaternion (a, b) Source # mzipWith :: (a -> b -> c) -> Quaternion a -> Quaternion b -> Quaternion c Source # munzip :: Quaternion (a, b) -> (Quaternion a, Quaternion b) Source #
Serial1 Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods serializeWith :: MonadPut m => (a -> m ()) -> Quaternion a -> m () Source # deserializeWith :: MonadGet m => m a -> m (Quaternion a) Source #
Hashable1 Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods liftHashWithSalt :: (Int -> a -> Int) -> Int -> Quaternion a -> Int Source #
Apply Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods (<.>) :: Quaternion (a -> b) -> Quaternion a -> Quaternion b Source # (.>) :: Quaternion a -> Quaternion b -> Quaternion b Source # (<.) :: Quaternion a -> Quaternion b -> Quaternion a Source # liftF2 :: (a -> b -> c) -> Quaternion a -> Quaternion b -> Quaternion c Source #
Bind Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods (>>-) :: Quaternion a -> (a -> Quaternion b) -> Quaternion b Source # join :: Quaternion (Quaternion a) -> Quaternion a Source #
Additive Quaternion Source # |

Instance details

Defined in Linear.Quaternion

Methods

zero :: Num a => Quaternion a Source #

(^+^) :: Num a => Quaternion a -> Quaternion a -> Quaternion a Source #

(^-^) :: Num a => Quaternion a -> Quaternion a -> Quaternion a Source #

lerp :: Num a => a -> Quaternion a -> Quaternion a -> Quaternion a Source #

liftU2 :: (a -> a -> a) -> Quaternion a -> Quaternion a -> Quaternion a Source #

liftI2 :: (a -> b -> c) -> Quaternion a -> Quaternion b -> Quaternion c Source #

Metric Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods dot :: Num a => Quaternion a -> Quaternion a -> a Source # quadrance :: Num a => Quaternion a -> a Source # qd :: Num a => Quaternion a -> Quaternion a -> a Source # distance :: Floating a => Quaternion a -> Quaternion a -> a Source # norm :: Floating a => Quaternion a -> a Source # signorm :: Floating a => Quaternion a -> Quaternion a Source #
Finite Quaternion Source # |
Instance details Defined in Linear.Quaternion Associated Types type Size Quaternion :: Nat Source # Methods toV :: Quaternion a -> V (Size Quaternion) a Source # fromV :: V (Size Quaternion) a -> Quaternion a Source #
Hamiltonian Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods _j :: Lens' (Quaternion a) a Source # _k :: Lens' (Quaternion a) a Source # _ijk :: Lens' (Quaternion a) (V3 a) Source #
Complicated Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods _e :: Lens' (Quaternion a) a Source # _i :: Lens' (Quaternion a) a Source #
Trace Quaternion Source # |
Instance details Defined in Linear.Trace Methods trace :: Num a => Quaternion (Quaternion a) -> a Source # diagonal :: Quaternion (Quaternion a) -> Quaternion a Source #
Affine Quaternion Source # |
Instance details Defined in Linear.Affine Associated Types type Diff Quaternion :: Type -> Type Source # Methods (.-.) :: Num a => Quaternion a -> Quaternion a -> Diff Quaternion a Source # (.+^) :: Num a => Quaternion a -> Diff Quaternion a -> Quaternion a Source # (.-^) :: Num a => Quaternion a -> Diff Quaternion a -> Quaternion a Source #
Unbox a => Vector Vector (Quaternion a) Source # |

Instance details

Defined in Linear.Quaternion

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (Quaternion a) -> m (Vector (Quaternion a)) Source #

basicUnsafeThaw :: PrimMonad m => Vector (Quaternion a) -> m (Mutable Vector (PrimState m) (Quaternion a)) Source #

basicLength :: Vector (Quaternion a) -> Int Source #

basicUnsafeSlice :: Int -> Int -> Vector (Quaternion a) -> Vector (Quaternion a) Source #

basicUnsafeIndexM :: Monad m => Vector (Quaternion a) -> Int -> m (Quaternion a) Source #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (Quaternion a) -> Vector (Quaternion a) -> m () Source #

elemseq :: Vector (Quaternion a) -> Quaternion a -> b -> b Source #

Unbox a => MVector MVector (Quaternion a) Source # |

Instance details

Defined in Linear.Quaternion

Methods

basicLength :: MVector s (Quaternion a) -> Int Source #

basicUnsafeSlice :: Int -> Int -> MVector s (Quaternion a) -> MVector s (Quaternion a) Source #

basicOverlaps :: MVector s (Quaternion a) -> MVector s (Quaternion a) -> Bool Source #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (Quaternion a)) Source #

basicInitialize :: PrimMonad m => MVector (PrimState m) (Quaternion a) -> m () Source #

basicUnsafeReplicate :: PrimMonad m => Int -> Quaternion a -> m (MVector (PrimState m) (Quaternion a)) Source #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (Quaternion a) -> Int -> m (Quaternion a) Source #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (Quaternion a) -> Int -> Quaternion a -> m () Source #

basicClear :: PrimMonad m => MVector (PrimState m) (Quaternion a) -> m () Source #

basicSet :: PrimMonad m => MVector (PrimState m) (Quaternion a) -> Quaternion a -> m () Source #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (Quaternion a) -> MVector (PrimState m) (Quaternion a) -> m () Source #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (Quaternion a) -> MVector (PrimState m) (Quaternion a) -> m () Source #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (Quaternion a) -> Int -> m (MVector (PrimState m) (Quaternion a)) Source #

(Num r, TrivialConjugate r) => Coalgebra r (E Quaternion) Source # |
Instance details Defined in Linear.Algebra Methods comult :: (E Quaternion -> r) -> E Quaternion -> E Quaternion -> r Source # counital :: (E Quaternion -> r) -> r Source #
(Num r, TrivialConjugate r) => Algebra r (E Quaternion) Source # |
Instance details Defined in Linear.Algebra Methods mult :: (E Quaternion -> E Quaternion -> r) -> E Quaternion -> r Source # unital :: r -> E Quaternion -> r Source #
Eq a => Eq (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion Methods (==) :: Quaternion a -> Quaternion a -> Bool Source # (/=) :: Quaternion a -> Quaternion a -> Bool Source #
RealFloat a => Floating (Quaternion a) Source # |

Instance details

Defined in Linear.Quaternion

Methods

pi :: Quaternion a Source #

exp :: Quaternion a -> Quaternion a Source #

log :: Quaternion a -> Quaternion a Source #

sqrt :: Quaternion a -> Quaternion a Source #

(**) :: Quaternion a -> Quaternion a -> Quaternion a Source #

logBase :: Quaternion a -> Quaternion a -> Quaternion a Source #

sin :: Quaternion a -> Quaternion a Source #

cos :: Quaternion a -> Quaternion a Source #

tan :: Quaternion a -> Quaternion a Source #

asin :: Quaternion a -> Quaternion a Source #

acos :: Quaternion a -> Quaternion a Source #

atan :: Quaternion a -> Quaternion a Source #

sinh :: Quaternion a -> Quaternion a Source #

cosh :: Quaternion a -> Quaternion a Source #

tanh :: Quaternion a -> Quaternion a Source #

asinh :: Quaternion a -> Quaternion a Source #

acosh :: Quaternion a -> Quaternion a Source #

atanh :: Quaternion a -> Quaternion a Source #

log1p :: Quaternion a -> Quaternion a Source #

expm1 :: Quaternion a -> Quaternion a Source #

log1pexp :: Quaternion a -> Quaternion a Source #

log1mexp :: Quaternion a -> Quaternion a Source #

RealFloat a => Fractional (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion Methods (/) :: Quaternion a -> Quaternion a -> Quaternion a Source # recip :: Quaternion a -> Quaternion a Source # fromRational :: Rational -> Quaternion a Source #
Data a => Data (Quaternion a) Source # |

Instance details

Defined in Linear.Quaternion

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Quaternion a -> c (Quaternion a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Quaternion a) Source #

toConstr :: Quaternion a -> Constr Source #

dataTypeOf :: Quaternion a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Quaternion a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Quaternion a)) Source #

gmapT :: (forall b. Data b => b -> b) -> Quaternion a -> Quaternion a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Quaternion a -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Quaternion a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Quaternion a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Quaternion a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Quaternion a -> m (Quaternion a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Quaternion a -> m (Quaternion a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Quaternion a -> m (Quaternion a) Source #

RealFloat a => Num (Quaternion a) Source # |

Instance details

Defined in Linear.Quaternion

Methods

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

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

(*) :: Quaternion a -> Quaternion a -> Quaternion a Source #

negate :: Quaternion a -> Quaternion a Source #

abs :: Quaternion a -> Quaternion a Source #

signum :: Quaternion a -> Quaternion a Source #

fromInteger :: Integer -> Quaternion a Source #

Ord a => Ord (Quaternion a) Source # |

Instance details

Defined in Linear.Quaternion

Methods

compare :: Quaternion a -> Quaternion a -> Ordering Source #

(<) :: Quaternion a -> Quaternion a -> Bool Source #

(<=) :: Quaternion a -> Quaternion a -> Bool Source #

(>) :: Quaternion a -> Quaternion a -> Bool Source #

(>=) :: Quaternion a -> Quaternion a -> Bool Source #

max :: Quaternion a -> Quaternion a -> Quaternion a Source #

min :: Quaternion a -> Quaternion a -> Quaternion a Source #

Read a => Read (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion Methods readsPrec :: Int -> ReadS (Quaternion a) Source # readList :: ReadS [Quaternion a] Source # readPrec :: ReadPrec (Quaternion a) Source # readListPrec :: ReadPrec [Quaternion a] Source #
Show a => Show (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion Methods showsPrec :: Int -> Quaternion a -> ShowS Source # show :: Quaternion a -> String Source # showList :: [Quaternion a] -> ShowS Source #
Ix a => Ix (Quaternion a) Source # |

Instance details

Defined in Linear.Quaternion

Methods

range :: (Quaternion a, Quaternion a) -> [Quaternion a] Source #

index :: (Quaternion a, Quaternion a) -> Quaternion a -> Int Source #

unsafeIndex :: (Quaternion a, Quaternion a) -> Quaternion a -> Int

inRange :: (Quaternion a, Quaternion a) -> Quaternion a -> Bool Source #

rangeSize :: (Quaternion a, Quaternion a) -> Int Source #

unsafeRangeSize :: (Quaternion a, Quaternion a) -> Int

Generic (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion Associated Types type Rep (Quaternion a) :: Type -> Type Source # Methods from :: Quaternion a -> Rep (Quaternion a) x Source # to :: Rep (Quaternion a) x -> Quaternion a Source #
Lift a => Lift (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion Methods lift :: Quaternion a -> Q Exp Source #
Storable a => Storable (Quaternion a) Source # |

Instance details

Defined in Linear.Quaternion

Methods

sizeOf :: Quaternion a -> Int Source #

alignment :: Quaternion a -> Int Source #

peekElemOff :: Ptr (Quaternion a) -> Int -> IO (Quaternion a) Source #

pokeElemOff :: Ptr (Quaternion a) -> Int -> Quaternion a -> IO () Source #

peekByteOff :: Ptr b -> Int -> IO (Quaternion a) Source #

pokeByteOff :: Ptr b -> Int -> Quaternion a -> IO () Source #

peek :: Ptr (Quaternion a) -> IO (Quaternion a) Source #

poke :: Ptr (Quaternion a) -> Quaternion a -> IO () Source #

Binary a => Binary (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion Methods put :: Quaternion a -> Put Source # get :: Get (Quaternion a) Source # putList :: [Quaternion a] -> Put Source #
Serial a => Serial (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion Methods serialize :: MonadPut m => Quaternion a -> m () Source # deserialize :: MonadGet m => m (Quaternion a) Source #
Serialize a => Serialize (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion Methods put :: Putter (Quaternion a) Source # get :: Get (Quaternion a) Source #
NFData a => NFData (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion Methods rnf :: Quaternion a -> () Source #
Hashable a => Hashable (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion Methods hashWithSalt :: Int -> Quaternion a -> Int Source # hash :: Quaternion a -> Int Source #
Unbox a => Unbox (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion
Ixed (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion Methods ix :: Index (Quaternion a) -> Traversal' (Quaternion a) (IxValue (Quaternion a)) Source #
(Conjugate a, RealFloat a) => Conjugate (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion Methods conjugate :: Quaternion a -> Quaternion a Source #
(RealFloat a, Epsilon a) => Epsilon (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion Methods nearZero :: Quaternion a -> Bool Source #
Generic1 Quaternion Source # |
Instance details Defined in Linear.Quaternion Associated Types type Rep1 Quaternion :: k -> Type Source # Methods from1 :: Quaternion a -> Rep1 Quaternion a Source # to1 :: Rep1 Quaternion a -> Quaternion a Source #
FunctorWithIndex (E Quaternion) Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods imap :: (E Quaternion -> a -> b) -> Quaternion a -> Quaternion b Source # imapped :: IndexedSetter (E Quaternion) (Quaternion a) (Quaternion b) a b Source #
FoldableWithIndex (E Quaternion) Quaternion Source # |

Instance details

Defined in Linear.Quaternion

Methods

ifoldMap :: Monoid m => (E Quaternion -> a -> m) -> Quaternion a -> m Source #

ifolded :: IndexedFold (E Quaternion) (Quaternion a) a Source #

ifoldr :: (E Quaternion -> a -> b -> b) -> b -> Quaternion a -> b Source #

ifoldl :: (E Quaternion -> b -> a -> b) -> b -> Quaternion a -> b Source #

ifoldr' :: (E Quaternion -> a -> b -> b) -> b -> Quaternion a -> b Source #

ifoldl' :: (E Quaternion -> b -> a -> b) -> b -> Quaternion a -> b Source #

TraversableWithIndex (E Quaternion) Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods itraverse :: Applicative f => (E Quaternion -> a -> f b) -> Quaternion a -> f (Quaternion b) Source # itraversed :: IndexedTraversal (E Quaternion) (Quaternion a) (Quaternion b) a b Source #
Each (Quaternion a) (Quaternion b) a b Source # |
Instance details Defined in Linear.Quaternion Methods each :: Traversal (Quaternion a) (Quaternion b) a b Source #
Field1 (Quaternion a) (Quaternion a) a a Source # |
Instance details Defined in Linear.Quaternion Methods _1 :: Lens (Quaternion a) (Quaternion a) a a Source #
Field2 (Quaternion a) (Quaternion a) a a Source # |
Instance details Defined in Linear.Quaternion Methods _2 :: Lens (Quaternion a) (Quaternion a) a a Source #
Field3 (Quaternion a) (Quaternion a) a a Source # |
Instance details Defined in Linear.Quaternion Methods _3 :: Lens (Quaternion a) (Quaternion a) a a Source #
Field4 (Quaternion a) (Quaternion a) a a Source # |
Instance details Defined in Linear.Quaternion Methods _4 :: Lens (Quaternion a) (Quaternion a) a a Source #
type Rep Quaternion Source # |
Instance details Defined in Linear.Quaternion type Rep Quaternion = E Quaternion
type Size Quaternion Source # |
Instance details Defined in Linear.Quaternion type Size Quaternion = 4
type Diff Quaternion Source # |
Instance details Defined in Linear.Affine type Diff Quaternion = Quaternion
data MVector s (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion data MVector s (Quaternion a) = MV_Quaternion !Int (MVector s a)
type Rep (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion type Rep (Quaternion a) = D1 (MetaData "Quaternion" "Linear.Quaternion" "linear-1.20.9-AXvcltmUzhAPqVQGbnzsL" False) (C1 (MetaCons "Quaternion" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a) :*: S1 (MetaSel (Nothing :: Maybe Symbol) SourceUnpack SourceStrict DecidedStrict) (Rec0 (V3 a))))
data Vector (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion data Vector (Quaternion a) = V_Quaternion !Int (Vector a)
type Index (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion type Index (Quaternion a) = E Quaternion
type IxValue (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion type IxValue (Quaternion a) = a
type Rep1 Quaternion Source # |
Instance details Defined in Linear.Quaternion type Rep1 Quaternion = D1 (MetaData "Quaternion" "Linear.Quaternion" "linear-1.20.9-AXvcltmUzhAPqVQGbnzsL" False) (C1 (MetaCons "Quaternion" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) Par1 :*: S1 (MetaSel (Nothing :: Maybe Symbol) SourceUnpack SourceStrict DecidedStrict) (Rec1 V3)))

class Complicated t where Source #

A vector space that includes the basis elements `_e` and `_i`

Methods

_e :: Lens' (t a) a Source #

_i :: Lens' (t a) a Source #

Instances

Complicated Complex Source # |
Instance details Defined in Linear.Quaternion Methods _e :: Lens' (Complex a) a Source # _i :: Lens' (Complex a) a Source #
Complicated Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods _e :: Lens' (Quaternion a) a Source # _i :: Lens' (Quaternion a) a Source #

class Complicated t => Hamiltonian t where Source #

A vector space that includes the basis elements `_e`, `_i`, `_j` and `_k`

Methods

_j :: Lens' (t a) a Source #

_k :: Lens' (t a) a Source #

_ijk :: Lens' (t a) (V3 a) Source #

Instances

Hamiltonian Quaternion Source # |
Instance details Defined in Linear.Quaternion Methods _j :: Lens' (Quaternion a) a Source # _k :: Lens' (Quaternion a) a Source # _ijk :: Lens' (Quaternion a) (V3 a) Source #

ee :: Complicated t => E t Source #

ei :: Complicated t => E t Source #

ej :: Hamiltonian t => E t Source #

ek :: Hamiltonian t => E t Source #

slerp :: RealFloat a => Quaternion a -> Quaternion a -> a -> Quaternion a Source #

Spherical linear interpolation between two quaternions.

asinq :: RealFloat a => Quaternion a -> Quaternion a -> Quaternion a Source #

`asin` with a specified branch cut.

acosq :: RealFloat a => Quaternion a -> Quaternion a -> Quaternion a Source #

`acos` with a specified branch cut.

atanq :: RealFloat a => Quaternion a -> Quaternion a -> Quaternion a Source #

`atan` with a specified branch cut.

asinhq :: RealFloat a => Quaternion a -> Quaternion a -> Quaternion a Source #

`asinh` with a specified branch cut.

acoshq :: RealFloat a => Quaternion a -> Quaternion a -> Quaternion a Source #

`acosh` with a specified branch cut.

atanhq :: RealFloat a => Quaternion a -> Quaternion a -> Quaternion a Source #

`atanh` with a specified branch cut.

absi :: Floating a => Quaternion a -> a Source #

norm of the imaginary component

pow :: RealFloat a => Quaternion a -> a -> Quaternion a Source #

raise a `Quaternion` to a scalar power

rotate :: (Conjugate a, RealFloat a) => Quaternion a -> V3 a -> V3 a Source #

Apply a rotation to a vector.

axisAngle :: (Epsilon a, Floating a) => V3 a -> a -> Quaternion a Source #

``axisAngle` axis theta` builds a `Quaternion` representing a rotation of `theta` radians about `axis`.