(
newpoints: list[Point], points: list[Point], tol: int = 4
)
| 600 | |
| 601 | |
| 602 | def check_too_far( |
| 603 | newpoints: list[Point], points: list[Point], tol: int = 4 |
| 604 | ) -> bool: |
| 605 | if len(points) < 2: |
| 606 | return False |
| 607 | avg = sum(points, Point(0.0, 0.0)) * 1.0 / len(points) |
| 608 | maxdist = max([p.distance(avg) for p in points]) |
| 609 | for p in newpoints: |
| 610 | if p.distance(avg) > maxdist * tol: |
| 611 | return True |
| 612 | return False |
| 613 | |
| 614 | |
| 615 | def check_aconst(args: list[Point]) -> bool: |
no test coverage detected