docs: def draw_line(start, size, slope):
      """
      Draws a line from the starting point with the given slope, until the line goes out of the given bounds.
      :param start: The starting point (x, y) for the line
      :param size: The size of the image as (width, height). This determined the bounds for the image.
      :param slope: The slope of the line
      :return: Yields a set of points as coordinate (0,0)
      """
      error = -1.0
      if abs(slope) > 1:
          slope = 1/slope
          switch_xy = True
      else:
          switch_xy = False
      slope_sgn = sign(slope)
      # represent change from inital x and y. If slope > 1, these are switched, since the algorithm only works when
      # the slope is less than 1.
      dx = dy = 0
      current_point = start
      x0, y0 = start
      while in_bounds((0, 0), size, current_point):
          yield current_point
          dx += 1
          error += abs(slope)
          if error > 0:
              dy += slope_sgn
              error -= 1
          current_point = (x0 + dx, y0 + dy) if not switch_xy else (x0 + abs(dy), y0 + slope_sgn * dx)