class_docstr: Static class which draws diamonds (i.e. rhombuses)
class_docstr_tok: ["Static","class","which","draws","diamonds","(","i.e",".","rhombuses",")"]
docstr: Determines where the rhombus centered at (center_x, center_y)
  intersects with a line drawn from (source_x, source_y) to
  (center_x, center_y).
  
  @see: ShapeDrawer.intersection_point
docstr_tok: ["Determines","where","the","rhombus","centered","at","(","center_x",",","center_y",")","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 rhombus centered at (center_x, center_y)
      intersects with a line drawn from (source_x, source_y) to
      (center_x, center_y).
  
      @see: ShapeDrawer.intersection_point"""
      height = height or width
  
      if height == 0 and width == 0:
          return center_x, center_y
  
      delta_x, delta_y = source_x - center_x, source_y - center_y
  
      # Treat edge case when delta_x = 0
      if delta_x == 0:
          if delta_y == 0:
              return center_x, center_y
          else:
              return center_x, center_y + copysign(height / 2, delta_y)
  
      width = copysign(width, delta_x)
      height = copysign(height, delta_y)
  
      f = height / (height + width * delta_y / delta_x)
      return center_x + f * width / 2, center_y + (1 - f) * height / 2
  
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 DiamondDrawer obj's underlying member method code with example usage: obj.intersection_point(center_x, center_y, source_x, source_y, width, height) and returns: unknown,  unknown, center_x,  center_y, center_x,  center_y, center_x,  unknown