Test with a larger set of points.
()
| 218 | |
| 219 | |
| 220 | def test_large_hull() -> None: |
| 221 | """Test with a larger set of points.""" |
| 222 | # Create a circle of points |
| 223 | import math |
| 224 | |
| 225 | points = [] |
| 226 | for i in range(20): |
| 227 | angle = 2 * math.pi * i / 20 |
| 228 | x = math.cos(angle) |
| 229 | y = math.sin(angle) |
| 230 | points.append(Point(x, y)) |
| 231 | |
| 232 | # Add some interior points |
| 233 | points.append(Point(0, 0)) |
| 234 | points.append(Point(0.5, 0.5)) |
| 235 | points.append(Point(-0.3, 0.2)) |
| 236 | |
| 237 | hull = graham_scan(points) |
| 238 | |
| 239 | # The hull should contain the circle points but not the interior points |
| 240 | assert len(hull) >= 3 |
| 241 | assert Point(0, 0) not in hull |
| 242 | assert Point(0.5, 0.5) not in hull |
| 243 | assert Point(-0.3, 0.2) not in hull |
| 244 | |
| 245 | |
| 246 | def test_random_order() -> None: |
nothing calls this directly
no test coverage detected