improved intersection calculations

- line intersection function are now located inside the Line class in
order to be overridden inside the Segment class