module Geometry
  ( sphereVolume
  , sphereArea
  , cubeVolume
  , cubeArea
  , cuboidArea
  , cuboidVolume
  ) where

sphereVolume :: Float -> Float
sphereVolume radius = (4.0 * pi * radius^3)/3

sphereArea :: Float -> Float
sphereArea radius = 4 * pi * (radius^2)

cubeVolume :: Float -> Float
cubeVolume length = length^3

cubeArea :: Float -> Float
cubeArea length = 6*length^2

cuboidArea :: Float -> Float -> Float -> Float
cuboidArea a b c = rectArea a b * 2 + rectArea a c * 2 + rectArea c b * 2

cuboidVolume :: Float -> Float -> Float -> Float
cuboidVolume a b c = rectArea a b * c

rectArea :: Float -> Float -> Float
rectArea a b = a * b
