* Document everything.
-* Test whether or not dropping the guards from the Tetrahedron.volume
- function speeds things up (and still produces a correct result).
-
* Re-run hpc and remove any dead code.
-- page 436.
{-# INLINE volume #-}
volume :: Tetrahedron -> Double
-volume t
- | v0' == v1' = 0
- | v0' == v2' = 0
- | v0' == v3' = 0
- | v1' == v2' = 0
- | v1' == v3' = 0
- | v2' == v3' = 0
- | otherwise = (1/6)*(det v0' v1' v2' v3')
- where
- v0' = v0 t
- v1' = v1 t
- v2' = v2 t
- v3' = v3 t
-
+volume (Tetrahedron _ v0' v1' v2' v3' _) =
+ (1/6)*(det v0' v1' v2' v3')
-- | The barycentric coordinates of a point with respect to v0.
{-# INLINE b0 #-}