module Face where import Point import ThreeDimensional data Face = Face { v0 :: Point, v1 :: Point, v2 :: Point, v3 :: Point } deriving (Eq) instance Show Face where show f = "Face:\n" ++ " v0: " ++ (show (v0 f)) ++ "\n" ++ " v1: " ++ (show (v1 f)) ++ "\n" ++ " v2: " ++ (show (v2 f)) ++ "\n" ++ " v3: " ++ (show (v3 f)) ++ "\n" 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