예제 #1
0
def test_angle(points1, points2, expected_angle):
    segment1 = Segment(*points1)
    segment2 = Segment(*points2)

    assert segment1.angle(segment2) == pytest.approx(expected_angle)
예제 #2
0
def test_angle_nan():
    segment1 = Segment(Point([1, 1]), Point([1, 2]))
    segment2 = Segment(Point([0, 0]), Point([0, 0]))

    with pytest.warns(GeometryAlgorithmsWarning):
        assert np.isnan(segment1.angle(segment2))