class_docstr: Class representing a rectangle.
class_docstr_tok: ["Class","representing","a","rectangle","."]
docstr: Returns the union of this rectangle with another.
  
  The resulting rectangle is the smallest rectangle that contains both
  rectangles.
  
  Example::
  
      >>> r1 = Rectangle(10, 10, 30, 30)
      >>> r2 = Rectangle(20, 20, 50, 50)
      >>> r3 = Rectangle(70, 70, 90, 90)
      >>> r1.union(r2)
      Rectangle(10.0, 10.0, 50.0, 50.0)
      >>> r2 | r1
      Rectangle(10.0, 10.0, 50.0, 50.0)
      >>> r2.union(r1) == r1.union(r2)
      True
      >>> r1.union(r3)
      Rectangle(10.0, 10.0, 90.0, 90.0)
docstr_tok: ["Returns","the","union","of","this","rectangle","with","another",".","The","resulting","rectangle","is","the","smallest","rectangle","that","contains","both","rectangles",".","Example",":",":",">",">",">","r1","=","Rectangle","(","10",",","10",",","30",",","30",")",">",">",">","r2","=","Rectangle","(","20",",","20",",","50",",","50",")",">",">",">","r3","=","Rectangle","(","70",",","70",",","90",",","90",")",">",">",">","r1.union","(","r2",")","Rectangle","(","10.0",",","10.0",",","50.0",",","50.0",")",">",">",">","r2","|","r1","Rectangle","(","10.0",",","10.0",",","50.0",",","50.0",")",">",">",">","r2.union","(","r1",")","==","r1.union","(","r2",")","True",">",">",">","r1.union","(","r3",")","Rectangle","(","10.0",",","10.0",",","90.0",",","90.0",")"]
code: def union(self, other):
      """Returns the union of this rectangle with another.
  
      The resulting rectangle is the smallest rectangle that contains both
      rectangles.
  
      Example::
  
          >>> r1 = Rectangle(10, 10, 30, 30)
          >>> r2 = Rectangle(20, 20, 50, 50)
          >>> r3 = Rectangle(70, 70, 90, 90)
          >>> r1.union(r2)
          Rectangle(10.0, 10.0, 50.0, 50.0)
          >>> r2 | r1
          Rectangle(10.0, 10.0, 50.0, 50.0)
          >>> r2.union(r1) == r1.union(r2)
          True
          >>> r1.union(r3)
          Rectangle(10.0, 10.0, 90.0, 90.0)
      """
      return Rectangle(
          min(self._left, other._left),
          min(self._top, other._top),
          max(self._right, other._right),
          max(self._bottom, other._bottom),
      )
  
imports: from collections import defaultdict
  from math import atan2, cos, hypot, sin
  from typing import NamedTuple
  from igraph.utils import consecutive_pairs
label_desc: Use image node_id 28 for calling the Rectangle obj's underlying member method code with example usage: obj.union(other) and returns: Rectangle