Paste: 3D rotations in haskell

Author: wagstaff
Mode: haskell
Date: Mon, 19 Jul 2010 21:46:45
Plain Text |
data Posn = Posn Int Int Int 

rotF1 (Posn x y z) = Posn x (-z) y
rotF2 (Posn x y z) = Posn (-z) y x
rotF3 (Posn x y z) = Posn (-y) x z
rotD1 (Posn x y z) = Posn z x y
rotD2 (Posn x y z) = Posn (-z) (-x) y
rotD3 (Posn x y z) = Posn (-z) x (-y)
rotD4 (Posn x y z) = Posn z (-x) (-y)
rotL1 (Posn x y z) = Posn (-y) (-x) (-z)
rotL2 (Posn x y z) = Posn (-z) (-y) (-x)
rotL3 (Posn x y z) = Posn (-x) (-z) (-y)
rotL4 (Posn x y z) = Posn (-x) z y
rotL5 (Posn x y z) = Posn z (-y) x
rotL6 (Posn x y z) = Posn y x (-z)

New Annotation

Summary:
Author:
Mode:
Body: