LineSegment class implemented.