def setExtendedPoint(lineSegmentEnd, pointOriginal, x):
 if ((x > min(lineSegmentEnd.point.real, pointOriginal.real)) and (x < max(lineSegmentEnd.point.real, pointOriginal.real))):
  lineSegmentEnd.point = complex(x, pointOriginal.imag)

def setExtendedPoint ( lineSegmentEnd , pointOriginal , x ) : if ( ( x > min ( lineSegmentEnd . point . real , pointOriginal . real ) ) and ( x < max ( lineSegmentEnd . point . real , pointOriginal . real ) ) ) : lineSegmentEnd . point = complex ( x , pointOriginal . imag )
set the point in the extended line segment .