X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FCube.hs;h=6b2121cf117ed98e6d25b6a37f02a0a8341841ee;hb=0a1f963086ef11db21da4f9d45780e7e7ea1ed7a;hp=5b5f2af690d3230bf06595ae133a05b313b840a3;hpb=30bc407abc86ffa9a0eb4b26bdb4890f3ea423d1;p=spline3.git 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