linear-0.6.1: Linear Algebra

Portability non-portable experimental Edward Kmett None

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 Metric Quaternion Core Quaternion Hamiltonian Quaternion Complicated Quaternion Eq a => Eq (Quaternion a) (Fractional (Quaternion a), RealFloat a) => Floating (Quaternion a) (Num (Quaternion a), RealFloat a) => Fractional (Quaternion a) (Typeable (Quaternion a), Data a) => Data (Quaternion a) RealFloat a => Num (Quaternion a) (Eq (Quaternion a), Ord a) => Ord (Quaternion a) Read a => Read (Quaternion a) Show a => Show (Quaternion a) (Ord (Quaternion a), Ix a) => Ix (Quaternion a) Storable a => Storable (Quaternion a) (Num (Quaternion a), RealFloat a, Epsilon a) => Epsilon (Quaternion a) (Num (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

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

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

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

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

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