class_docstr: Static class which draws rectangular vertices
class_docstr_tok: ["Static","class","which","draws","rectangular","vertices"]
docstr: Determines where the rectangle centered at (center_x, center_y)
  having the given width and height intersects with a line drawn from
  (source_x, source_y) to (center_x, center_y).
  
  @see: ShapeDrawer.intersection_point
docstr_tok: ["Determines","where","the","rectangle","centered","at","(","center_x",",","center_y",")","having","the","given","width","and","height","intersects","with","a","line","drawn","from","(","source_x",",","source_y",")","to","(","center_x",",","center_y",")",".","@","see",":","ShapeDrawer.intersection_point"]
code: def intersection_point(
      center_x, center_y, source_x, source_y, width, height=None
  ):
      """Determines where the rectangle centered at (center_x, center_y)
      having the given width and height intersects with a line drawn from
      (source_x, source_y) to (center_x, center_y).
  
      @see: ShapeDrawer.intersection_point"""
      height = height or width
      delta_x, delta_y = center_x - source_x, center_y - source_y
  
      if delta_x == 0 and delta_y == 0:
          return center_x, center_y
  
      if delta_y > 0 and delta_x <= delta_y and delta_x >= -delta_y:
          # this is the top edge
          ry = center_y - height / 2
          ratio = (height / 2) / delta_y
          return center_x - ratio * delta_x, ry
  
      if delta_y < 0 and delta_x <= -delta_y and delta_x >= delta_y:
          # this is the bottom edge
          ry = center_y + height / 2
          ratio = (height / 2) / -delta_y
          return center_x - ratio * delta_x, ry
  
      if delta_x > 0 and delta_y <= delta_x and delta_y >= -delta_x:
          # this is the left edge
          rx = center_x - width / 2
          ratio = (width / 2) / delta_x
          return rx, center_y - ratio * delta_y
  
      if delta_x < 0 and delta_y <= -delta_x and delta_y >= delta_x:
          # this is the right edge
          rx = center_x + width / 2
          ratio = (width / 2) / -delta_x
          return rx, center_y - ratio * delta_y
  
      if delta_x == 0:
          if delta_y > 0:
              return center_x, center_y - height / 2
          return center_x, center_y + height / 2
  
      if delta_y == 0:
          if delta_x > 0:
              return center_x - width / 2, center_y
          return center_x + width / 2, center_y
  
imports: from abc import ABCMeta, abstractmethod
  from math import atan2, copysign, cos, pi, sin
  import sys
  from igraph.drawing.matplotlib.utils import find_matplotlib
label_desc: Use image node_id 2 for calling the RectangleDrawer obj's underlying member method code with example usage: obj.intersection_point(center_x, center_y, source_x, source_y, width, height) and returns: center_x,  center_y, unknown,  ry, unknown,  ry, rx,  unknown, rx,  unknown, center_x,  unknown, unknown,  center_y, center_x,  unknown, unknown,  center_y