Function isLineSegment