def isSegmentInX(segment, xFirst, xSecond):
 segmentFirstX = segment[0].point.real
 segmentSecondX = segment[1].point.real
 if (min(segmentFirstX, segmentSecondX) > max(xFirst, xSecond)):
  return False
 return (max(segmentFirstX, segmentSecondX) > min(xFirst, xSecond))

def isSegmentInX ( segment , xFirst , xSecond ) : segmentFirstX = segment [ 0 ] . point . real segmentSecondX = segment [ 1 ] . point . real if ( min ( segmentFirstX , segmentSecondX ) > max ( xFirst , xSecond ) ) : return False return ( max ( segmentFirstX , segmentSecondX ) > min ( xFirst , xSecond ) )
determine if the segment overlaps within x .