Implemented class and interface for LineSegment class as asked per Q6