diff options
author | Picca Frédéric-Emmanuel <picca@debian.org> | 2019-02-02 12:55:46 +0100 |
---|---|---|
committer | Picca Frédéric-Emmanuel <picca@debian.org> | 2019-02-02 12:55:46 +0100 |
commit | 30098174e89f801160dc7656642eaaf34822a1f5 (patch) | |
tree | da8d68c1328bc641139c5724a08ca1f76e57bac5 /contrib/haskell/src/Hkl/PyFAI/PoniExt.hs | |
parent | b97bde539e3e5568f29ee50211f8decdea0a8aaf (diff) | |
parent | b3cce9a78f1862dcaeeebc6784b70b3f116e583d (diff) |
Update upstream source from tag 'upstream/5.0.0.2456'
Update to upstream version '5.0.0.2456'
with Debian dir fdd1364b79a1292c1ac74d5d36b9b54742d56b0b
Diffstat (limited to 'contrib/haskell/src/Hkl/PyFAI/PoniExt.hs')
-rw-r--r-- | contrib/haskell/src/Hkl/PyFAI/PoniExt.hs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/contrib/haskell/src/Hkl/PyFAI/PoniExt.hs b/contrib/haskell/src/Hkl/PyFAI/PoniExt.hs new file mode 100644 index 0000000..63234f1 --- /dev/null +++ b/contrib/haskell/src/Hkl/PyFAI/PoniExt.hs @@ -0,0 +1,41 @@ +{-# LANGUAGE UnicodeSyntax #-} + +module Hkl.PyFAI.PoniExt + ( PoniExt(..) + , flip + , move + , set + ) where + +import Numeric.LinearAlgebra (ident) +import Numeric.Units.Dimensional.Prelude (Angle, Length) + +import Hkl.MyMatrix +import Hkl.PyFAI.Poni + +import Prelude hiding (flip) + +data PoniExt = PoniExt Poni Pose deriving (Show) + +flip :: PoniExt -> PoniExt +flip (PoniExt ps mym1) = PoniExt p mym1 + where + p = map poniEntryFlip ps + +set ∷ PoniExt + → (Length Double) -- ^ distance + → (Length Double) -- ^ poni1 + → (Length Double) -- ^ poni2 + → (Angle Double) -- ^ rot1 + → (Angle Double) -- ^ rot2 + → (Angle Double) -- ^ rot3 + → PoniExt +set (PoniExt ps _) d p1 p2 r1 r2 r3 = PoniExt p pose + where + p = map (poniEntrySet d p1 p2 r1 r2 r3) ps + pose = Pose (MyMatrix HklB (ident 3)) + +move :: PoniExt -> Pose -> PoniExt +move (PoniExt p1 (Pose mym1)) (Pose mym2) = PoniExt p (Pose mym2) + where + p = map (poniEntryMove mym1 mym2) p1 |