i :: Int,
j :: Int,
k :: Int,
- fv :: FunctionValues,
- tetrahedra_volume :: Double }
+ fv :: FunctionValues }
deriving (Eq)
j' <- choose (coordmin, coordmax)
k' <- choose (coordmin, coordmax)
fv' <- arbitrary :: Gen FunctionValues
- (Positive tet_vol) <- arbitrary :: Gen (Positive Double)
- return (Cube h' i' j' k' fv' tet_vol)
+ return (Cube h' i' j' k' fv')
where
coordmin = -268435456 -- -(2^29 / 2)
coordmax = 268435456 -- +(2^29 / 2)
-- | Returns an empty 'Cube'.
empty_cube :: Cube
-empty_cube = Cube 0 0 0 0 empty_values 0
+empty_cube = Cube 0 0 0 0 empty_values
-- | The left-side boundary of the cube. See Sorokina and Zeilfelder,
v3' = (center c) + (-delta, delta, -delta)
-make_tetrahedron :: Cube -> Point -> Point -> Point -> Point -> Tetrahedron
-make_tetrahedron c v0 v1 v2 v3 =
- Tetrahedron (Cube.fv c) v0 v1 v2 v3 (tetrahedra_volume c)
-
-
tetrahedron0 :: Cube -> Tetrahedron
tetrahedron0 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron (Cube.fv c) v0' v1' v2' v3'
where
v0' = center c
v1' = center (front_face c)
tetrahedron1 :: Cube -> Tetrahedron
tetrahedron1 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (front_face c)
tetrahedron2 :: Cube -> Tetrahedron
tetrahedron2 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (front_face c)
tetrahedron3 :: Cube -> Tetrahedron
tetrahedron3 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (front_face c)
tetrahedron4 :: Cube -> Tetrahedron
tetrahedron4 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (top_face c)
tetrahedron5 :: Cube -> Tetrahedron
tetrahedron5 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (top_face c)
tetrahedron6 :: Cube -> Tetrahedron
tetrahedron6 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (top_face c)
tetrahedron7 :: Cube -> Tetrahedron
tetrahedron7 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (top_face c)
tetrahedron8 :: Cube -> Tetrahedron
tetrahedron8 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (back_face c)
tetrahedron9 :: Cube -> Tetrahedron
tetrahedron9 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (back_face c)
tetrahedron10 :: Cube -> Tetrahedron
tetrahedron10 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (back_face c)
tetrahedron11 :: Cube -> Tetrahedron
tetrahedron11 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (back_face c)
tetrahedron12 :: Cube -> Tetrahedron
tetrahedron12 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (down_face c)
tetrahedron13 :: Cube -> Tetrahedron
tetrahedron13 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (down_face c)
tetrahedron14 :: Cube -> Tetrahedron
tetrahedron14 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (down_face c)
tetrahedron15 :: Cube -> Tetrahedron
tetrahedron15 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (down_face c)
tetrahedron16 :: Cube -> Tetrahedron
tetrahedron16 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (right_face c)
tetrahedron17 :: Cube -> Tetrahedron
tetrahedron17 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (right_face c)
tetrahedron18 :: Cube -> Tetrahedron
tetrahedron18 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (right_face c)
tetrahedron19 :: Cube -> Tetrahedron
tetrahedron19 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (right_face c)
tetrahedron20 :: Cube -> Tetrahedron
tetrahedron20 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (left_face c)
tetrahedron21 :: Cube -> Tetrahedron
tetrahedron21 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (left_face c)
tetrahedron22 :: Cube -> Tetrahedron
tetrahedron22 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (left_face c)
tetrahedron23 :: Cube -> Tetrahedron
tetrahedron23 c =
- make_tetrahedron c v0' v1' v2' v3'
+ Tetrahedron fv' v0' v1' v2' v3'
where
v0' = center c
v1' = center (left_face c)
import Numeric.LinearAlgebra hiding (i, scale)
import Prelude hiding (LT)
-import Test.QuickCheck (Arbitrary(..), Gen, Positive(..))
+import Test.QuickCheck (Arbitrary(..), Gen)
import Cardinal
import Comparisons (nearly_ge)
v0 :: Point,
v1 :: Point,
v2 :: Point,
- v3 :: Point,
- precomputed_volume :: Double }
+ v3 :: Point }
deriving (Eq)
rnd_v2 <- arbitrary :: Gen Point
rnd_v3 <- arbitrary :: Gen Point
rnd_fv <- arbitrary :: Gen FunctionValues
- (Positive rnd_vol) <- arbitrary :: Gen (Positive Double)
- return (Tetrahedron rnd_fv rnd_v0 rnd_v1 rnd_v2 rnd_v3 rnd_vol)
+ return (Tetrahedron rnd_fv rnd_v0 rnd_v1 rnd_v2 rnd_v3)
instance Show Tetrahedron where
-- | The barycentric coordinates of a point with respect to v0.
b0 :: Tetrahedron -> (RealFunction Point)
-b0 t point = (volume inner_tetrahedron) / (precomputed_volume t)
+b0 t point = (volume inner_tetrahedron) / (volume t)
where
inner_tetrahedron = t { v0 = point }
-- | The barycentric coordinates of a point with respect to v1.
b1 :: Tetrahedron -> (RealFunction Point)
-b1 t point = (volume inner_tetrahedron) / (precomputed_volume t)
+b1 t point = (volume inner_tetrahedron) / (volume t)
where
inner_tetrahedron = t { v1 = point }
-- | The barycentric coordinates of a point with respect to v2.
b2 :: Tetrahedron -> (RealFunction Point)
-b2 t point = (volume inner_tetrahedron) / (precomputed_volume t)
+b2 t point = (volume inner_tetrahedron) / (volume t)
where
inner_tetrahedron = t { v2 = point }
-- | The barycentric coordinates of a point with respect to v3.
b3 :: Tetrahedron -> (RealFunction Point)
-b3 t point = (volume inner_tetrahedron) / (precomputed_volume t)
+b3 t point = (volume inner_tetrahedron) / (volume t)
where
inner_tetrahedron = t { v3 = point }