An essay on the foundations of geometry