Return the angle toward to point from (minx, miny) :param point: The target point minx: The starting point's x miny: The starting point's y :return: the angle Examples: >>> angle_comparer((1,1), 0, 0) 45.0 >>> angle_comparer((100,1), 10, 10) -5.71
(point: tuple[int, int], minx: int, miny: int)
| 26 | |
| 27 | |
| 28 | def angle_comparer(point: tuple[int, int], minx: int, miny: int) -> float: |
| 29 | """Return the angle toward to point from (minx, miny) |
| 30 | |
| 31 | :param point: The target point |
| 32 | minx: The starting point's x |
| 33 | miny: The starting point's y |
| 34 | :return: the angle |
| 35 | |
| 36 | Examples: |
| 37 | >>> angle_comparer((1,1), 0, 0) |
| 38 | 45.0 |
| 39 | |
| 40 | >>> angle_comparer((100,1), 10, 10) |
| 41 | -5.710593137499642 |
| 42 | |
| 43 | >>> angle_comparer((5,5), 2, 3) |
| 44 | 33.690067525979785 |
| 45 | """ |
| 46 | # sort the points accorgind to the angle from the lowest and the most left point |
| 47 | x, y = point |
| 48 | return degrees(atan2(y - miny, x - minx)) |
| 49 | |
| 50 | |
| 51 | def check_direction( |