linear-1.3: Linear Algebra

Portability non-portable experimental Edward Kmett Trustworthy

Linear.Quaternion

Description

Quaternions

Synopsis

# Documentation

data Quaternion a Source

Quaternions

Constructors

 Quaternion !a !(V3 a)

Instances

 Monad Quaternion Functor Quaternion Typeable1 Quaternion Applicative Quaternion Foldable Quaternion Traversable Quaternion Distributive Quaternion Apply Quaternion Bind Quaternion Additive Quaternion Metric Quaternion Core Quaternion Hamiltonian Quaternion Complicated Quaternion Trace Quaternion Affine Quaternion Eq a => Eq (Quaternion a) RealFloat a => Floating (Quaternion a) RealFloat a => Fractional (Quaternion a) Data a => Data (Quaternion a) RealFloat a => Num (Quaternion a) Ord a => Ord (Quaternion a) Read a => Read (Quaternion a) Show a => Show (Quaternion a) Ix a => Ix (Quaternion a) Storable a => Storable (Quaternion a) (RealFloat a, Epsilon a) => Epsilon (Quaternion a) (Conjugate a, RealFloat a) => Conjugate (Quaternion a)

class Complicated t whereSource

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

Methods

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

``` `_e` :: Lens' (t a) a
```

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

``` `_i` :: Lens' (t a) a
```

Instances

 Complicated Complex Complicated Quaternion

class Complicated t => Hamiltonian t whereSource

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

Methods

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

``` `_j` :: Lens' (t a) a
```

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

``` `_k` :: Lens' (t a) a
```

_ijk :: Functor f => (V3 a -> f (V3 a)) -> t a -> f (t a)Source

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

Instances

 Hamiltonian Quaternion

slerp :: RealFloat a => Quaternion a -> Quaternion a -> a -> Quaternion aSource

Spherical linear interpolation between two quaternions.

asinq :: RealFloat a => Quaternion a -> Quaternion a -> Quaternion aSource

`asin` with a specified branch cut.

acosq :: RealFloat a => Quaternion a -> Quaternion a -> Quaternion aSource

`acos` with a specified branch cut.

atanq :: RealFloat a => Quaternion a -> Quaternion a -> Quaternion aSource

`atan` with a specified branch cut.

asinhq :: RealFloat a => Quaternion a -> Quaternion a -> Quaternion aSource

`asinh` with a specified branch cut.

acoshq :: RealFloat a => Quaternion a -> Quaternion a -> Quaternion aSource

`acosh` with a specified branch cut.

atanhq :: RealFloat a => Quaternion a -> Quaternion a -> Quaternion aSource

`atanh` with a specified branch cut.

absi :: Floating a => Quaternion a -> aSource

norm of the imaginary component

pow :: RealFloat a => Quaternion a -> a -> Quaternion aSource

raise a `Quaternion` to a scalar power

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

Apply a rotation to a vector.

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

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