SpatialMath-0.2.7.1: 3d math including quaternions/euler angles/dcms and utility functions
Safe HaskellSafe-Inferred
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

Instances details
Num a => Rotation (M33 a) a Source # 
Instance details

Defined in SpatialMathT

Methods

compose :: Rot f1 f2 (M33 a) -> Rot f2 f3 (M33 a) -> Rot f1 f3 (M33 a) Source #

rot :: Rot f1 f2 (M33 a) -> V3T f1 a -> V3T f2 a Source #

rot' :: Rot f1 f2 (M33 a) -> V3T f2 a -> V3T f1 a Source #

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

transpose :: Rot f1 f2 (M33 a) -> Rot f2 f1 (M33 a) Source #

Num a => Rotation (Quaternion a) a Source # 
Instance details

Defined in SpatialMathT

Methods

compose :: Rot f1 f2 (Quaternion a) -> Rot f2 f3 (Quaternion a) -> Rot f1 f3 (Quaternion a) Source #

rot :: Rot f1 f2 (Quaternion a) -> V3T f1 a -> V3T f2 a Source #

rot' :: Rot f1 f2 (Quaternion a) -> V3T f2 a -> V3T f1 a Source #

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

transpose :: Rot f1 f2 (Quaternion a) -> Rot f2 f1 (Quaternion a) Source #

newtype Rot f1 f2 r Source #

Constructors

Rot 

Fields

Instances

Instances details
Generic1 (Rot f1 f2 :: Type -> Type) Source # 
Instance details

Defined in SpatialMathT

Associated Types

type Rep1 (Rot f1 f2) :: k -> Type #

Methods

from1 :: forall (a :: k). Rot f1 f2 a -> Rep1 (Rot f1 f2) a #

to1 :: forall (a :: k). Rep1 (Rot f1 f2) a -> Rot f1 f2 a #

Foldable (Rot f1 f2) Source # 
Instance details

Defined in SpatialMathT

Methods

fold :: Monoid m => Rot f1 f2 m -> m #

foldMap :: Monoid m => (a -> m) -> Rot f1 f2 a -> m #

foldMap' :: Monoid m => (a -> m) -> Rot f1 f2 a -> m #

foldr :: (a -> b -> b) -> b -> Rot f1 f2 a -> b #

foldr' :: (a -> b -> b) -> b -> Rot f1 f2 a -> b #

foldl :: (b -> a -> b) -> b -> Rot f1 f2 a -> b #

foldl' :: (b -> a -> b) -> b -> Rot f1 f2 a -> b #

foldr1 :: (a -> a -> a) -> Rot f1 f2 a -> a #

foldl1 :: (a -> a -> a) -> Rot f1 f2 a -> a #

toList :: Rot f1 f2 a -> [a] #

null :: Rot f1 f2 a -> Bool #

length :: Rot f1 f2 a -> Int #

elem :: Eq a => a -> Rot f1 f2 a -> Bool #

maximum :: Ord a => Rot f1 f2 a -> a #

minimum :: Ord a => Rot f1 f2 a -> a #

sum :: Num a => Rot f1 f2 a -> a #

product :: Num a => Rot f1 f2 a -> a #

Traversable (Rot f1 f2) Source # 
Instance details

Defined in SpatialMathT

Methods

traverse :: Applicative f => (a -> f b) -> Rot f1 f2 a -> f (Rot f1 f2 b) #

sequenceA :: Applicative f => Rot f1 f2 (f a) -> f (Rot f1 f2 a) #

mapM :: Monad m => (a -> m b) -> Rot f1 f2 a -> m (Rot f1 f2 b) #

sequence :: Monad m => Rot f1 f2 (m a) -> m (Rot f1 f2 a) #

Functor (Rot f1 f2) Source # 
Instance details

Defined in SpatialMathT

Methods

fmap :: (a -> b) -> Rot f1 f2 a -> Rot f1 f2 b #

(<$) :: a -> Rot f1 f2 b -> Rot f1 f2 a #

Storable r => Storable (Rot f1 f2 r) Source # 
Instance details

Defined in SpatialMathT

Methods

sizeOf :: Rot f1 f2 r -> Int #

alignment :: Rot f1 f2 r -> Int #

peekElemOff :: Ptr (Rot f1 f2 r) -> Int -> IO (Rot f1 f2 r) #

pokeElemOff :: Ptr (Rot f1 f2 r) -> Int -> Rot f1 f2 r -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Rot f1 f2 r) #

pokeByteOff :: Ptr b -> Int -> Rot f1 f2 r -> IO () #

peek :: Ptr (Rot f1 f2 r) -> IO (Rot f1 f2 r) #

poke :: Ptr (Rot f1 f2 r) -> Rot f1 f2 r -> IO () #

Generic (Rot f1 f2 r) Source # 
Instance details

Defined in SpatialMathT

Associated Types

type Rep (Rot f1 f2 r) :: Type -> Type #

Methods

from :: Rot f1 f2 r -> Rep (Rot f1 f2 r) x #

to :: Rep (Rot f1 f2 r) x -> Rot f1 f2 r #

Num r => Num (Rot f1 f2 r) Source # 
Instance details

Defined in SpatialMathT

Methods

(+) :: Rot f1 f2 r -> Rot f1 f2 r -> Rot f1 f2 r #

(-) :: Rot f1 f2 r -> Rot f1 f2 r -> Rot f1 f2 r #

(*) :: Rot f1 f2 r -> Rot f1 f2 r -> Rot f1 f2 r #

negate :: Rot f1 f2 r -> Rot f1 f2 r #

abs :: Rot f1 f2 r -> Rot f1 f2 r #

signum :: Rot f1 f2 r -> Rot f1 f2 r #

fromInteger :: Integer -> Rot f1 f2 r #

Fractional r => Fractional (Rot f1 f2 r) Source # 
Instance details

Defined in SpatialMathT

Methods

(/) :: Rot f1 f2 r -> Rot f1 f2 r -> Rot f1 f2 r #

recip :: Rot f1 f2 r -> Rot f1 f2 r #

fromRational :: Rational -> Rot f1 f2 r #

Show r => Show (Rot f1 f2 r) Source # 
Instance details

Defined in SpatialMathT

Methods

showsPrec :: Int -> Rot f1 f2 r -> ShowS #

show :: Rot f1 f2 r -> String #

showList :: [Rot f1 f2 r] -> ShowS #

Binary r => Binary (Rot f1 f2 r) Source # 
Instance details

Defined in SpatialMathT

Methods

put :: Rot f1 f2 r -> Put #

get :: Get (Rot f1 f2 r) #

putList :: [Rot f1 f2 r] -> Put #

Serialize r => Serialize (Rot f1 f2 r) Source # 
Instance details

Defined in SpatialMathT

Methods

put :: Putter (Rot f1 f2 r) #

get :: Get (Rot f1 f2 r) #

Eq r => Eq (Rot f1 f2 r) Source # 
Instance details

Defined in SpatialMathT

Methods

(==) :: Rot f1 f2 r -> Rot f1 f2 r -> Bool #

(/=) :: Rot f1 f2 r -> Rot f1 f2 r -> Bool #

Ord r => Ord (Rot f1 f2 r) Source # 
Instance details

Defined in SpatialMathT

Methods

compare :: Rot f1 f2 r -> Rot f1 f2 r -> Ordering #

(<) :: Rot f1 f2 r -> Rot f1 f2 r -> Bool #

(<=) :: Rot f1 f2 r -> Rot f1 f2 r -> Bool #

(>) :: Rot f1 f2 r -> Rot f1 f2 r -> Bool #

(>=) :: Rot f1 f2 r -> Rot f1 f2 r -> Bool #

max :: Rot f1 f2 r -> Rot f1 f2 r -> Rot f1 f2 r #

min :: Rot f1 f2 r -> Rot f1 f2 r -> Rot f1 f2 r #

type Rep1 (Rot f1 f2 :: Type -> Type) Source # 
Instance details

Defined in SpatialMathT

type Rep1 (Rot f1 f2 :: Type -> Type) = D1 ('MetaData "Rot" "SpatialMathT" "SpatialMath-0.2.7.1-FJ8akJ7FKV75UBVB9UHiZk" 'True) (C1 ('MetaCons "Rot" 'PrefixI 'True) (S1 ('MetaSel ('Just "unR") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))
type Rep (Rot f1 f2 r) Source # 
Instance details

Defined in SpatialMathT

type Rep (Rot f1 f2 r) = D1 ('MetaData "Rot" "SpatialMathT" "SpatialMath-0.2.7.1-FJ8akJ7FKV75UBVB9UHiZk" 'True) (C1 ('MetaCons "Rot" 'PrefixI 'True) (S1 ('MetaSel ('Just "unR") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 r)))

newtype V3T f a Source #

Constructors

V3T 

Fields

Instances

Instances details
Generic1 (V3T f :: Type -> TYPE LiftedRep) Source # 
Instance details

Defined in SpatialMathT

Associated Types

type Rep1 (V3T f) :: k -> Type #

Methods

from1 :: forall (a :: k). V3T f a -> Rep1 (V3T f) a #

to1 :: forall (a :: k). Rep1 (V3T f) a -> V3T f a #

Foldable (V3T f) Source # 
Instance details

Defined in SpatialMathT

Methods

fold :: Monoid m => V3T f m -> m #

foldMap :: Monoid m => (a -> m) -> V3T f a -> m #

foldMap' :: Monoid m => (a -> m) -> V3T f a -> m #

foldr :: (a -> b -> b) -> b -> V3T f a -> b #

foldr' :: (a -> b -> b) -> b -> V3T f a -> b #

foldl :: (b -> a -> b) -> b -> V3T f a -> b #

foldl' :: (b -> a -> b) -> b -> V3T f a -> b #

foldr1 :: (a -> a -> a) -> V3T f a -> a #

foldl1 :: (a -> a -> a) -> V3T f a -> a #

toList :: V3T f a -> [a] #

null :: V3T f a -> Bool #

length :: V3T f a -> Int #

elem :: Eq a => a -> V3T f a -> Bool #

maximum :: Ord a => V3T f a -> a #

minimum :: Ord a => V3T f a -> a #

sum :: Num a => V3T f a -> a #

product :: Num a => V3T f a -> a #

Traversable (V3T f) Source # 
Instance details

Defined in SpatialMathT

Methods

traverse :: Applicative f0 => (a -> f0 b) -> V3T f a -> f0 (V3T f b) #

sequenceA :: Applicative f0 => V3T f (f0 a) -> f0 (V3T f a) #

mapM :: Monad m => (a -> m b) -> V3T f a -> m (V3T f b) #

sequence :: Monad m => V3T f (m a) -> m (V3T f a) #

Applicative (V3T f) Source # 
Instance details

Defined in SpatialMathT

Methods

pure :: a -> V3T f a #

(<*>) :: V3T f (a -> b) -> V3T f a -> V3T f b #

liftA2 :: (a -> b -> c) -> V3T f a -> V3T f b -> V3T f c #

(*>) :: V3T f a -> V3T f b -> V3T f b #

(<*) :: V3T f a -> V3T f b -> V3T f a #

Functor (V3T f) Source # 
Instance details

Defined in SpatialMathT

Methods

fmap :: (a -> b) -> V3T f a -> V3T f b #

(<$) :: a -> V3T f b -> V3T f a #

Metric (V3T f) Source # 
Instance details

Defined in SpatialMathT

Methods

dot :: Num a => V3T f a -> V3T f a -> a #

quadrance :: Num a => V3T f a -> a #

qd :: Num a => V3T f a -> V3T f a -> a #

distance :: Floating a => V3T f a -> V3T f a -> a #

norm :: Floating a => V3T f a -> a #

signorm :: Floating a => V3T f a -> V3T f a #

R1 (V3T f) Source # 
Instance details

Defined in SpatialMathT

Methods

_x :: Lens' (V3T f a) a #

R2 (V3T f) Source # 
Instance details

Defined in SpatialMathT

Methods

_y :: Lens' (V3T f a) a #

_xy :: Lens' (V3T f a) (V2 a) #

R3 (V3T f) Source # 
Instance details

Defined in SpatialMathT

Methods

_z :: Lens' (V3T f a) a #

_xyz :: Lens' (V3T f a) (V3 a) #

Additive (V3T f) Source # 
Instance details

Defined in SpatialMathT

Methods

zero :: Num a => V3T f a #

(^+^) :: Num a => V3T f a -> V3T f a -> V3T f a #

(^-^) :: Num a => V3T f a -> V3T f a -> V3T f a #

lerp :: Num a => a -> V3T f a -> V3T f a -> V3T f a #

liftU2 :: (a -> a -> a) -> V3T f a -> V3T f a -> V3T f a #

liftI2 :: (a -> b -> c) -> V3T f a -> V3T f b -> V3T f c #

Storable a => Storable (V3T f a) Source # 
Instance details

Defined in SpatialMathT

Methods

sizeOf :: V3T f a -> Int #

alignment :: V3T f a -> Int #

peekElemOff :: Ptr (V3T f a) -> Int -> IO (V3T f a) #

pokeElemOff :: Ptr (V3T f a) -> Int -> V3T f a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (V3T f a) #

pokeByteOff :: Ptr b -> Int -> V3T f a -> IO () #

peek :: Ptr (V3T f a) -> IO (V3T f a) #

poke :: Ptr (V3T f a) -> V3T f a -> IO () #

Generic (V3T f a) Source # 
Instance details

Defined in SpatialMathT

Associated Types

type Rep (V3T f a) :: Type -> Type #

Methods

from :: V3T f a -> Rep (V3T f a) x #

to :: Rep (V3T f a) x -> V3T f a #

Num a => Num (V3T f a) Source # 
Instance details

Defined in SpatialMathT

Methods

(+) :: V3T f a -> V3T f a -> V3T f a #

(-) :: V3T f a -> V3T f a -> V3T f a #

(*) :: V3T f a -> V3T f a -> V3T f a #

negate :: V3T f a -> V3T f a #

abs :: V3T f a -> V3T f a #

signum :: V3T f a -> V3T f a #

fromInteger :: Integer -> V3T f a #

Fractional a => Fractional (V3T f a) Source # 
Instance details

Defined in SpatialMathT

Methods

(/) :: V3T f a -> V3T f a -> V3T f a #

recip :: V3T f a -> V3T f a #

fromRational :: Rational -> V3T f a #

Show a => Show (V3T f a) Source # 
Instance details

Defined in SpatialMathT

Methods

showsPrec :: Int -> V3T f a -> ShowS #

show :: V3T f a -> String #

showList :: [V3T f a] -> ShowS #

Binary a => Binary (V3T f a) Source # 
Instance details

Defined in SpatialMathT

Methods

put :: V3T f a -> Put #

get :: Get (V3T f a) #

putList :: [V3T f a] -> Put #

Serialize a => Serialize (V3T f a) Source # 
Instance details

Defined in SpatialMathT

Methods

put :: Putter (V3T f a) #

get :: Get (V3T f a) #

Eq a => Eq (V3T f a) Source # 
Instance details

Defined in SpatialMathT

Methods

(==) :: V3T f a -> V3T f a -> Bool #

(/=) :: V3T f a -> V3T f a -> Bool #

Ord a => Ord (V3T f a) Source # 
Instance details

Defined in SpatialMathT

Methods

compare :: V3T f a -> V3T f a -> Ordering #

(<) :: V3T f a -> V3T f a -> Bool #

(<=) :: V3T f a -> V3T f a -> Bool #

(>) :: V3T f a -> V3T f a -> Bool #

(>=) :: V3T f a -> V3T f a -> Bool #

max :: V3T f a -> V3T f a -> V3T f a #

min :: V3T f a -> V3T f a -> V3T f a #

type Rep1 (V3T f :: Type -> TYPE LiftedRep) Source # 
Instance details

Defined in SpatialMathT

type Rep1 (V3T f :: Type -> TYPE LiftedRep) = D1 ('MetaData "V3T" "SpatialMathT" "SpatialMath-0.2.7.1-FJ8akJ7FKV75UBVB9UHiZk" 'True) (C1 ('MetaCons "V3T" 'PrefixI 'True) (S1 ('MetaSel ('Just "unV") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 V3)))
type Rep (V3T f a) Source # 
Instance details

Defined in SpatialMathT

type Rep (V3T f a) = D1 ('MetaData "V3T" "SpatialMathT" "SpatialMath-0.2.7.1-FJ8akJ7FKV75UBVB9UHiZk" 'True) (C1 ('MetaCons "V3T" 'PrefixI 'True) (S1 ('MetaSel ('Just "unV") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (V3 a))))

class R1 (t :: Type -> Type) where #

A space that has at least 1 basis vector _x.

Methods

_x :: Lens' (t a) a #

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

Instances

Instances details
R1 Identity 
Instance details

Defined in Linear.V1

Methods

_x :: Lens' (Identity a) a #

R1 Quaternion 
Instance details

Defined in Linear.Quaternion

Methods

_x :: Lens' (Quaternion a) a #

R1 V1 
Instance details

Defined in Linear.V1

Methods

_x :: Lens' (V1 a) a #

R1 V2 
Instance details

Defined in Linear.V2

Methods

_x :: Lens' (V2 a) a #

R1 V3 
Instance details

Defined in Linear.V3

Methods

_x :: Lens' (V3 a) a #

R1 V4 
Instance details

Defined in Linear.V4

Methods

_x :: Lens' (V4 a) a #

R1 (V3T f) Source # 
Instance details

Defined in SpatialMathT

Methods

_x :: Lens' (V3T f a) a #

class R1 t => R2 (t :: Type -> Type) where #

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

Minimal complete definition

_xy

Methods

_y :: Lens' (t a) a #

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

_xy :: Lens' (t a) (V2 a) #

Instances

Instances details
R2 Quaternion 
Instance details

Defined in Linear.Quaternion

Methods

_y :: Lens' (Quaternion a) a #

_xy :: Lens' (Quaternion a) (V2 a) #

R2 V2 
Instance details

Defined in Linear.V2

Methods

_y :: Lens' (V2 a) a #

_xy :: Lens' (V2 a) (V2 a) #

R2 V3 
Instance details

Defined in Linear.V3

Methods

_y :: Lens' (V3 a) a #

_xy :: Lens' (V3 a) (V2 a) #

R2 V4 
Instance details

Defined in Linear.V4

Methods

_y :: Lens' (V4 a) a #

_xy :: Lens' (V4 a) (V2 a) #

R2 (V3T f) Source # 
Instance details

Defined in SpatialMathT

Methods

_y :: Lens' (V3T f a) a #

_xy :: Lens' (V3T f a) (V2 a) #

class R2 t => R3 (t :: Type -> Type) where #

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

Methods

_z :: Lens' (t a) a #

>>> V3 1 2 3 ^. _z
3

_xyz :: Lens' (t a) (V3 a) #

Instances

Instances details
R3 Quaternion 
Instance details

Defined in Linear.Quaternion

Methods

_z :: Lens' (Quaternion a) a #

_xyz :: Lens' (Quaternion a) (V3 a) #

R3 V3 
Instance details

Defined in Linear.V3

Methods

_z :: Lens' (V3 a) a #

_xyz :: Lens' (V3 a) (V3 a) #

R3 V4 
Instance details

Defined in Linear.V4

Methods

_z :: Lens' (V4 a) a #

_xyz :: Lens' (V4 a) (V3 a) #

R3 (V3T f) Source # 
Instance details

Defined in SpatialMathT

Methods

_z :: Lens' (V3T f a) a #

_xyz :: Lens' (V3T f a) (V3 a) #

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 #