def nearest_intersection(line0, line1):
 (Pa, Pb, intersection_dist) = nearest_intersection_points(line0, line1)
 if (Pa is not None):
  nPoint = (Pa - Pb)
  return ((Pb + (nPoint * 0.5)), intersection_dist)
 else:
  return (None, None)

def nearest_intersection ( line0 , line1 ) : ( Pa , Pb , intersection_dist ) = nearest_intersection_points ( line0 , line1 ) if ( Pa is not None ) : nPoint = ( Pa - Pb ) return ( ( Pb + ( nPoint * 0.5 ) ) , intersection_dist ) else : return ( None , None )
calculates the nearest intersection point .