code: def _gen_smoother_middle_points_from_3_points(pts, initial):
      p1 = pts[0]
      p2 = pts[1]
      p3 = pts[2]
      distance1 = sqrt((p2[0] - p1[0]) ** 2 + (p2[1] - p1[1]) ** 2)
      distance2 = sqrt((p3[0] - p1[0]) ** 2 + (p3[1] - p1[1]) ** 2)
      if distance1 < 1e-10 or distance2 < 1e-10:
          yield p2
      else:
          if distance1 < initial or distance2 < initial:
              yield p2
          else:
              p2a = _gen_point(p1, p2, initial)
              p2b = _gen_point(p3, p2, initial)
              if p2a is None or p2b is None:
                  yield p2
              else:
                  yield p2a
                  yield p2b
  
file_path: pygraphistry/graphistry/layout/utils/routing.py
imports: from .geometry import rectangle_point_intersection, angle_between_vectors, sqrt
label_desc: Use image node_id 4 for calling a global function with example usage: _gen_smoother_middle_points_from_3_points(pts, initial) without return types