code: def intersect_curves(nodes1, nodes2):
      r
      nodes1 = _curve_helpers.full_reduce(nodes1)
      nodes2 = _curve_helpers.full_reduce(nodes2)
      _, num_nodes1 = nodes1.shape
      _, num_nodes2 = nodes2.shape
      swapped = False
      if num_nodes1 > num_nodes2:
          nodes1, nodes2 = nodes2, nodes1
          swapped = True
      coeffs = normalize_polynomial(to_power_basis(nodes1, nodes2))
      if np.all(coeffs == 0.0):
          raise NotImplementedError(_COINCIDENT_ERR)
  
      _check_non_simple(coeffs)
      t_vals = roots_in_unit_interval(coeffs)
      final_s = []
      final_t = []
      for t_val in t_vals:
          (x_val,), (y_val,) = _curve_helpers.evaluate_multi(
              nodes2, np.asfortranarray([t_val])
          )
          s_val = locate_point(nodes1, x_val, y_val)
          if s_val is not None:
              _resolve_and_add(nodes1, s_val, final_s, nodes2, t_val, final_t)
      result = np.zeros((2, len(final_s)), order="F")
      if swapped:
          final_s, final_t = final_t, final_s
      result[0, :] = final_s
      result[1, :] = final_t
      return result
docs: r"""Intersect two parametric B |eacute| zier curves.
  
      Args:
          nodes1 (numpy.ndarray): The nodes in the first curve.
          nodes2 (numpy.ndarray): The nodes in the second curve.
  
      Returns:
          numpy.ndarray: ``2 x N`` array of intersection parameters.
          Each row contains a pair of values :math:`s` and :math:`t`
          (each in :math:`\left[0, 1\right]`) such that the curves
          intersect: :math:`B_1(s) = B_2(t)`.
  
      Raises:
          NotImplementedError: If the "intersection polynomial" is
          all zeros -- which indicates coincident curves.