code: def calc_intersect(a, b, c, d):
      """Calculate the intersection of two lines.
  
      Args:
          a (complex): Start point of first line.
          b (complex): End point of first line.
          c (complex): Start point of second line.
          d (complex): End point of second line.
  
      Returns:
          complex: Location of intersection if one present, ``complex(NaN,NaN)``
          if no intersection was found.
      """
      ab = b - a
      cd = d - c
      p = ab * 1j
      try:
          h = dot(p, a - c) / dot(p, cd)
      except ZeroDivisionError:
          return complex(NAN, NAN)
      return c + cd * h
  
file_path: catboost/contrib/python/fonttools/fontTools/cu2qu/cu2qu.py
imports: import math
  from .errors import Error, ApproxNotFoundError
label_desc: Use image node_id 9 for calling a global function with example usage: calc_intersect(a, b, c, d) and returns: unknown, complex