eval f (Product x y) = (eval f x) * (eval f y)
eval f (Quotient x y) = (eval f x) / (eval f y)
-value_at :: [[[Double]]] -> Int -> Int -> Int -> Double
+value_at :: [[[Double]]] -> Int -> Int -> Int -> Double
value_at values i j k =
((values !! k) !! j) !! i
back_right_down = value_at values (i+1) (j+1) (k-1),
back_right_top = value_at values (i+1) (j+1) (k+1),
interior = value_at values i j k }
+
+rotate :: FunctionValues -> (Cardinal -> Cardinal) -> FunctionValues
+rotate fv rotation =
+ FunctionValues { front = eval fv (rotation F),
+ back = eval fv (rotation B),
+ left = eval fv (rotation L),
+ right = eval fv (rotation R),
+ down = eval fv (rotation D),
+ top = eval fv (rotation T),
+ front_left = eval fv (rotation FL),
+ front_right = eval fv (rotation FR),
+ front_down = eval fv (rotation FD),
+ front_top = eval fv (rotation FT),
+ back_left = eval fv (rotation BL),
+ back_right = eval fv (rotation BR),
+ back_down = eval fv (rotation BD),
+ back_top = eval fv (rotation BT),
+ left_down = eval fv (rotation LD),
+ left_top = eval fv (rotation LT),
+ right_down = eval fv (rotation RD),
+ right_top = eval fv (rotation RT),
+ front_left_down = eval fv (rotation FLD),
+ front_left_top = eval fv (rotation FLT),
+ front_right_down = eval fv (rotation FRD),
+ front_right_top = eval fv (rotation FRT),
+ back_left_down = eval fv (rotation BLD),
+ back_left_top = eval fv (rotation BLT),
+ back_right_down = eval fv (rotation BRD),
+ back_right_top = eval fv (rotation BRT),
+ interior = interior fv }