MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / test_consecutive_orientation

Function test_consecutive_orientation

geometry/tests/test_graham_scan.py:207–217  ·  view source on GitHub ↗

Test orientation calculation.

()

Source from the content-addressed store, hash-verified

205
206
207def test_consecutive_orientation() -> None:
208 """Test orientation calculation."""
209 p1 = Point(0, 0)
210 p2 = Point(1, 0)
211 p3_ccw = Point(1, 1) # Counter-clockwise
212 p3_cw = Point(1, -1) # Clockwise
213 p3_collinear = Point(2, 0) # Collinear
214
215 assert p1.consecutive_orientation(p2, p3_ccw) > 0 # Counter-clockwise
216 assert p1.consecutive_orientation(p2, p3_cw) < 0 # Clockwise
217 assert p1.consecutive_orientation(p2, p3_collinear) == 0 # Collinear
218
219
220def test_large_hull() -> None:

Callers

nothing calls this directly

Calls 2

PointClass · 0.90

Tested by

no test coverage detected