There are two reasons why this happens:
- you haven't specified a module name in your file and when you don't specify the module then GHC assumes that you are in the 
Main module. 
- you haven't specified the entry point of a Haskell program, that is the main function.
 
The sum of this two reasons gives your error: no main function in the Main module.
One solution could be to add the main function:
main :: IO ()
main = return () -- do nothing
or, in alternative, compile your file as a library and then load it in ghci (or just load the .hs file in ghci). In this case you should give a module name to your library:
module Geometry where
[...]
and then import it where you use it with import Geometry.