center (Tetrahedron _ v0' v1' v2' v3' _) =
(v0' + v1' + v2' + v3') `scale` (1/4)
- contains_point t p =
+ contains_point t p0 =
b0_unscaled `nearly_ge` 0 &&
b1_unscaled `nearly_ge` 0 &&
b2_unscaled `nearly_ge` 0 &&
-- would do if we used the regular b0,..b3 functions.
b0_unscaled :: Double
b0_unscaled = volume inner_tetrahedron
- where inner_tetrahedron = t { v0 = p }
+ where inner_tetrahedron = t { v0 = p0 }
b1_unscaled :: Double
b1_unscaled = volume inner_tetrahedron
- where inner_tetrahedron = t { v1 = p }
+ where inner_tetrahedron = t { v1 = p0 }
b2_unscaled :: Double
b2_unscaled = volume inner_tetrahedron
- where inner_tetrahedron = t { v2 = p }
+ where inner_tetrahedron = t { v2 = p0 }
b3_unscaled :: Double
b3_unscaled = volume inner_tetrahedron
- where inner_tetrahedron = t { v3 = p }
+ where inner_tetrahedron = t { v3 = p0 }
polynomial :: Tetrahedron -> (RealFunction Point)