Пример #1
0
 def get_transformable_plane(self, x_range=None, y_range=None):
     """
     x_range and y_range would be tuples (min, max)
     """
     plane_config = dict(self.plane_config)
     shift_val = ORIGIN
     if x_range is not None:
         x_min, x_max = x_range
         plane_config["x_radius"] = x_max - x_min
         shift_val += (x_max + x_min) * RIGHT / 2.
     if y_range is not None:
         y_min, y_max = y_range
         plane_config["y_radius"] = y_max - y_min
         shift_val += (y_max + y_min) * UP / 2.
     plane = ComplexPlane(**plane_config)
     plane.shift(shift_val)
     if self.use_multicolored_plane:
         self.paint_plane(plane)
     return plane
Пример #2
0
 def add_background_plane(self):
     background = ComplexPlane(**self.plane_config)
     background.fade(self.background_fade_factor)
     self.add(background)
     self.background = background