spatial-math-0.2.4.0: 3d math including quaternions/euler angles/dcms and utility functions

Safe HaskellNone
LanguageHaskell2010

SpatialMathT

Synopsis

Documentation

class Rotation p a | p -> a where Source

Methods

compose :: Rot f1 f2 p -> Rot f2 f3 p -> Rot f1 f3 p Source

rot :: Rot f1 f2 p -> V3T f1 a -> V3T f2 a Source

rot' :: Rot f1 f2 p -> V3T f2 a -> V3T f1 a Source

toDcm :: Rot f1 f2 p -> Rot f1 f2 (M33 a) Source

transpose :: Rot f1 f2 p -> Rot f2 f1 p Source

Instances

Num a => Rotation (M33 a) a 
Num a => Rotation (Quaternion a) a 

newtype Rot f1 f2 r Source

Constructors

Rot 

Fields

unR :: r
 

Instances

Functor (Rot f1 f2) 
Foldable (Rot f1 f2) 
Traversable (Rot f1 f2) 
Generic1 (Rot f1 f2) 
Eq r => Eq (Rot f1 f2 r) 
Fractional r => Fractional (Rot f1 f2 r) 
Num r => Num (Rot f1 f2 r) 
Ord r => Ord (Rot f1 f2 r) 
Show r => Show (Rot f1 f2 r) 
Generic (Rot f1 f2 r) 
Storable r => Storable (Rot f1 f2 r) 
Binary r => Binary (Rot f1 f2 r) 
Serialize r => Serialize (Rot f1 f2 r) 
type Rep1 (Rot f1 f2) 
type Rep (Rot f1 f2 r) 

newtype V3T f a Source

Constructors

V3T 

Fields

unV :: V3 a
 

Instances

Functor (V3T f) 
Applicative (V3T f) 
Foldable (V3T f) 
Traversable (V3T f) 
Generic1 (V3T f) 
R3 (V3T f) 
R2 (V3T f) 
R1 (V3T f) 
Metric (V3T f) 
Additive (V3T f) 
Eq a => Eq (V3T f a) 
Fractional a => Fractional (V3T f a) 
Num a => Num (V3T f a) 
Ord a => Ord (V3T f a) 
Show a => Show (V3T f a) 
Generic (V3T f a) 
Storable a => Storable (V3T f a) 
Binary a => Binary (V3T f a) 
Serialize a => Serialize (V3T f a) 
type Rep1 (V3T f) 
type Rep (V3T f a) 

class R1 t where

A space that has at least 1 basis vector _x.

Minimal complete definition

Nothing

Methods

_x :: Functor f => (a -> f a) -> t a -> f (t a)

>>> V1 2 ^._x
2
>>> V1 2 & _x .~ 3
V1 3

Instances

R1 Identity 
R1 V4 
R1 V3 
R1 V2 
R1 V1 
R1 (V3T f) 

class R1 t => R2 t where

A space that distinguishes 2 orthogonal basis vectors _x and _y, but may have more.

Minimal complete definition

Nothing

Methods

_y :: Functor f => (a -> f a) -> t a -> f (t a)

>>> V2 1 2 ^._y
2
>>> V2 1 2 & _y .~ 3
V2 1 3

_xy :: Functor f => (V2 a -> f (V2 a)) -> t a -> f (t a)

Instances

R2 V4 
R2 V3 
R2 V2 
R2 (V3T f) 

class R2 t => R3 t where

A space that distinguishes 3 orthogonal basis vectors: _x, _y, and _z. (It may have more)

Minimal complete definition

Nothing

Methods

_z :: Functor f => (a -> f a) -> t a -> f (t a)

>>> V3 1 2 3 ^. _z
3

_xyz :: Functor f => (V3 a -> f (V3 a)) -> t a -> f (t a)

Instances

R3 V4 
R3 V3 
R3 (V3T f) 

type M33T f1 f2 a = V3T f1 (V3T f2 a) Source

cross :: Num a => V3T f a -> V3T f a -> V3T f a Source

orthonormalize :: Floating a => Rot f1 f2 (M33 a) -> Rot f1 f2 (M33 a) Source