From 0a1f963086ef11db21da4f9d45780e7e7ea1ed7a Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 10 Jul 2011 11:36:44 -0400 Subject: [PATCH] Added a find_containing_tetrahedra function to the Cube module. --- src/Cube.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Cube.hs b/src/Cube.hs index 5b5f2af..6b2121c 100644 --- a/src/Cube.hs +++ b/src/Cube.hs @@ -460,3 +460,13 @@ tetrahedrons c = tetrahedron21 c, tetrahedron22 c, tetrahedron23 c] + + +-- | Takes a 'Cube', and returns all Tetrahedra belonging to it that +-- contain the given 'Point'. +find_containing_tetrahedra :: Cube -> Point -> [Tetrahedron] +find_containing_tetrahedra c p = + filter contains_our_point all_tetrahedra + where + contains_our_point = flip contains_point p + all_tetrahedra = tetrahedrons c -- 2.43.2