MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / test_star_shape

Method test_star_shape

geometry/tests/test_jarvis_march.py:62–75  ·  view source on GitHub ↗

Test star shape - only tips are in hull.

(self)

Source from the content-addressed store, hash-verified

60 assert p5 not in hull
61
62 def test_star_shape(self) -> None:
63 """Test star shape - only tips are in hull."""
64 tips = [
65 Point(-5, 6),
66 Point(-11, 0),
67 Point(-9, -8),
68 Point(4, 4),
69 Point(6, -7),
70 ]
71 interior = [Point(-7, -2), Point(-2, -4), Point(0, 1)]
72 hull = jarvis_march(tips + interior)
73 assert len(hull) == 5
74 assert all(p in hull for p in tips)
75 assert not any(p in hull for p in interior)
76
77 def test_empty_list(self) -> None:
78 """Test empty list returns empty hull."""

Callers

nothing calls this directly

Calls 2

PointClass · 0.90
jarvis_marchFunction · 0.90

Tested by

no test coverage detected