From: Michael Orlitzky Date: Sun, 10 Jul 2011 15:36:44 +0000 (-0400) Subject: Added a find_containing_tetrahedra function to the Cube module. X-Git-Tag: 0.0.1~256 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=0a1f963086ef11db21da4f9d45780e7e7ea1ed7a;p=spline3.git Added a find_containing_tetrahedra function to the Cube module. --- 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