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

Safe HaskellSafe-Infered

Xyz

Synopsis

Documentation

data Xyz a Source

Constructors

Xyz a a a 

Instances

Functor Xyz 
Typeable1 Xyz 
Eq a => Eq (Xyz a) 
Floating a => Floating (Xyz a) 
Fractional a => Fractional (Xyz a) 
Data a => Data (Xyz a) 
Num a => Num (Xyz a) 
Show a => Show (Xyz a) 

zipWithXyz :: (a -> b -> c) -> Xyz a -> Xyz b -> Xyz cSource

cross :: Num a => Xyz a -> Xyz a -> Xyz aSource

c = a (cross) b

dot :: Num a => Xyz a -> Xyz a -> aSource

c = a (dot) b

normSquared :: Num a => Xyz a -> aSource

c = vec (dot) vec

norm :: Floating a => Xyz a -> aSource

norm(x)

distance :: Floating a => Xyz a -> Xyz a -> aSource

norm(a - b)

scale :: Num a => a -> Xyz a -> Xyz aSource

vec_out = vec_in*scale_factor

normalizeTo :: Floating a => a -> Xyz a -> Xyz a -> Xyz aSource

vec_out = scale (new_norm/norm(vec_in)) vec_in

normalize :: Floating a => Xyz a -> Xyz a -> Xyz aSource

vec_out = vec_in/norm(vec_in)

mult3x3ByXyz :: (Num a, Storable a) => Matrix a -> Xyz a -> Xyz aSource

v_out = M*v