(self, shift_distance=0)
| 728 | return self.__class__(x_1, y_1, x_2, y_2) |
| 729 | |
| 730 | def shift(self, shift_distance=0): |
| 731 | |
| 732 | if not isinstance(shift_distance, Iterable): |
| 733 | shift_x = shift_distance |
| 734 | shift_y = shift_distance |
| 735 | else: |
| 736 | assert ( |
| 737 | len(shift_distance) == 2 |
| 738 | ), "shift_distance should have 2 elements, one for x dimension and one for y dimension" |
| 739 | shift_x, shift_y = shift_distance |
| 740 | |
| 741 | x_1 = self.x_1 + shift_x |
| 742 | y_1 = self.y_1 + shift_y |
| 743 | x_2 = self.x_2 + shift_x |
| 744 | y_2 = self.y_2 + shift_y |
| 745 | return self.__class__(x_1, y_1, x_2, y_2) |
| 746 | |
| 747 | def scale(self, scale_factor=1): |
| 748 |
no outgoing calls