spatial-math 0.2.3.0 → 0.2.4.0
raw patch · 2 files changed
+18/−2 lines, 2 filesdep +lens
Dependencies added: lens
Files
- spatial-math.cabal +3/−2
- src/SpatialMathT.hs +15/−0
spatial-math.cabal view
@@ -1,5 +1,5 @@ name: spatial-math-version: 0.2.3.0+version: 0.2.4.0 synopsis: 3d math including quaternions/euler angles/dcms and utility functions description: This is a port of my 'mathlib' C library: `https://github.com/ghorn/mathlib` license: BSD3@@ -23,7 +23,8 @@ ghc-prim, cereal, binary,- linear >= 1.17.1+ linear >= 1.17.1,+ lens default-language: Haskell2010 source-repository head
src/SpatialMathT.hs view
@@ -12,6 +12,7 @@ ( Rotation(..) , Rot(..) , V3T(..)+ , R1(..), R2(..), R3(..) , M33T , cross , orthonormalize@@ -38,6 +39,20 @@ , Generic1, Generic , Serialize, Binary )++instance R1 (V3T f) where+ _x f (V3T v) = fmap V3T $ _x f v+ {-# INLINE _x #-}+instance R2 (V3T f) where+ _y f (V3T v) = fmap V3T $ _y f v+ {-# INLINE _y #-}+ _xy f (V3T v) = fmap V3T $ _xy f v+ {-# INLINE _xy #-}+instance R3 (V3T f) where+ _z f (V3T v) = fmap V3T $ _z f v+ {-# INLINE _z #-}+ _xyz f (V3T v) = fmap V3T $ _xyz f v+ {-# INLINE _xyz #-} cross :: Num a => V3T f a -> V3T f a -> V3T f a cross (V3T vx) (V3T vy) = V3T (vx `L.cross` vy)