code: def intersection(geom_1, geom_2, intersection_type):
      """Returns intersection between geometric objects.
  
      Explanation
      ===========
  
      Note that this function is meant for use in integration_reduction and
      at that point in the calling function the lines denoted by the segments
      surely intersect within segment boundaries. Coincident lines are taken
      to be non-intersecting. Also, the hyperplane intersection for 2D case is
      also implemented.
  
      Parameters
      ==========
  
      geom_1, geom_2:
          The input line segments.
  
      Examples
      ========
  
      >>> from sympy.integrals.intpoly import intersection
      >>> from sympy import Point, Segment2D
      >>> l1 = Segment2D(Point(1, 1), Point(3, 5))
      >>> l2 = Segment2D(Point(2, 0), Point(2, 5))
      >>> intersection(l1, l2, "segment2D")
      (2, 3)
      >>> p1 = ((-1, 0), 0)
      >>> p2 = ((0, 1), 1)
      >>> intersection(p1, p2, "plane2D")
      (0, 1)
      """
      if intersection_type[:-2] == "segment":
          if intersection_type == "segment2D":
              x1, y1 = geom_1.points[0]
              x2, y2 = geom_1.points[1]
              x3, y3 = geom_2.points[0]
              x4, y4 = geom_2.points[1]
          elif intersection_type == "segment3D":
              x1, y1, z1 = geom_1.points[0]
              x2, y2, z2 = geom_1.points[1]
              x3, y3, z3 = geom_2.points[0]
              x4, y4, z4 = geom_2.points[1]
  
          denom = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4)
          if denom:
              t1 = x1 * y2 - y1 * x2
              t2 = x3 * y4 - x4 * y3
              return (
                  S(t1 * (x3 - x4) - t2 * (x1 - x2)) / denom,
                  S(t1 * (y3 - y4) - t2 * (y1 - y2)) / denom,
              )
      if intersection_type[:-2] == "plane":
          if (
              intersection_type == "plane2D"
          ):  # Intersection of hyperplanes
              a1x, a1y = geom_1[0]
              a2x, a2y = geom_2[0]
              b1, b2 = geom_1[1], geom_2[1]
  
              denom = a1x * a2y - a2x * a1y
              if denom:
                  return (
                      S(b1 * a2y - b2 * a1y) / denom,
                      S(b2 * a1x - b1 * a2x) / denom,
                  )
  
imports: from functools import cmp_to_key
  from sympy.abc import x, y, z
  from sympy.core import S, diff, Expr, Symbol
  from sympy.core.sympify import _sympify
  from sympy.geometry import Segment2D, Polygon, Point, Point2D
  from sympy.polys.polytools import LC, gcd_list, degree_list, Poly
  from sympy.simplify.simplify import nsimplify
label_desc: Use image node_id 20 for calling a global function with example usage: intersection(geom_1, geom_2, intersection_type) and returns: unknown,  unknown, unknown,  unknown