]> gitweb.michael.orlitzky.com - spline3.git/blobdiff - src/Tetrahedron.hs
Remove the coincident vertices guards from the Tetrahedron volume function.
[spline3.git] / src / Tetrahedron.hs
index 75957291c4d37ce005448de53fb159785a73361a..2a4227a7f1bbee2d10a99baa66a07904e1e16c15 100644 (file)
@@ -313,20 +313,8 @@ det p0 p1 p2 p3 =
 --   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 #-}