-instance ThreeDimensional Face where
- center f = ((v0 f) + (v1 f) + (v2 f) + (v3 f)) `scale` (1/4)
- -- Too lazy to implement this right now.
- contains_point _ _ = False
+-- | Returns the center of the given face. Since a face is just
+-- square, we can average the four vertices to find its center. This
+-- is useful because the center of a face is always a vertex of a
+-- tetrahedron.
+center :: Face -> Point
+center (Face v0' v1' v2' v3') =
+ (v0' + v1' + v2' + v3') `scale` (1/4)