예제 #1
0
def test_point_ccw_iterable(A, B, C):
    p = Point(*A)
    q = Point(*B)
    r = Point(*C)

    assert p.ccw(q, C) > 0
    assert p.ccw(B, r) > 0
    assert p.ccw(B, C) > 0
예제 #2
0
def test_point_ccw_equal_zero():
    p = Point()
    q = Point(1, 0)
    r = Point(2, 0)
    assert p.ccw(q, r) == 0
예제 #3
0
def test_point_ccw_less_than_zero():
    p = Point()
    q = Point(1, 0)
    r = Point(1, 1)
    assert r.ccw(q, p) < 0
예제 #4
0
def test_point_ccw_greater_than_zero():
    p = Point()
    q = Point(1, 0)
    r = Point(1, 1)
    assert p.ccw(q, r) > 0