linear-1.20.3: 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 |
Functor Quaternion Source |
MonadFix Quaternion Source |
Applicative Quaternion Source |
Foldable Quaternion Source |
Traversable Quaternion Source |
Generic1 Quaternion Source |
Distributive Quaternion Source |
Representable Quaternion Source |
MonadZip Quaternion Source |
Serial1 Quaternion Source |
Apply Quaternion Source |
Bind Quaternion Source |
Eq1 Quaternion Source |
Ord1 Quaternion Source |
Read1 Quaternion Source |
Show1 Quaternion Source |
Additive Quaternion Source |
Metric Quaternion Source |
Hamiltonian Quaternion Source |
Complicated Quaternion Source |
Trace Quaternion Source |
Affine Quaternion Source |
Unbox a => Vector Vector (Quaternion a) Source |
Unbox a => MVector MVector (Quaternion a) Source |
(Num r, TrivialConjugate r) => Coalgebra r (E Quaternion) Source |
(Num r, TrivialConjugate r) => Algebra r (E Quaternion) Source |
Eq a => Eq (Quaternion a) Source |
RealFloat a => Floating (Quaternion a) Source |
RealFloat a => Fractional (Quaternion a) Source |
Data a => Data (Quaternion a) Source |
RealFloat a => Num (Quaternion a) Source |
Ord a => Ord (Quaternion a) Source |
Read a => Read (Quaternion a) Source |
Show a => Show (Quaternion a) Source |
Ix a => Ix (Quaternion a) Source |
Generic (Quaternion a) Source |
Storable a => Storable (Quaternion a) Source |
Binary a => Binary (Quaternion a) Source |
Serial a => Serial (Quaternion a) Source |
Serialize a => Serialize (Quaternion a) Source |
NFData a => NFData (Quaternion a) Source |
Hashable a => Hashable (Quaternion a) Source |
Unbox a => Unbox (Quaternion a) Source |
Ixed (Quaternion a) Source |
(RealFloat a, Epsilon a) => Epsilon (Quaternion a) Source |
(Conjugate a, RealFloat a) => Conjugate (Quaternion a) Source |
FunctorWithIndex (E Quaternion) Quaternion Source |
FoldableWithIndex (E Quaternion) Quaternion Source |
TraversableWithIndex (E Quaternion) Quaternion Source |
Each (Quaternion a) (Quaternion b) a b Source |
type Rep1 Quaternion Source |
type Rep Quaternion = E Quaternion Source |
type Diff Quaternion = Quaternion Source |
data MVector s (Quaternion a) = MV_Quaternion !Int (MVector s a) Source |
type Rep (Quaternion a) Source |
data Vector (Quaternion a) = V_Quaternion !Int (Vector a) Source |
type Index (Quaternion a) = E Quaternion Source |
type IxValue (Quaternion a) = a Source |

class Complicated t where Source

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

Minimal complete definition

Nothing

Methods

_e, _i :: Lens' (t a) a Source

Instances

Complicated Complex Source |
Complicated Quaternion Source |

class Complicated t => Hamiltonian t where Source

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

Minimal complete definition

Nothing

Methods

_j, _k :: Lens' (t a) a Source

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

Instances

Hamiltonian Quaternion 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`.