Ejemplo n.º 1
0
def test_add_subtract(arrays):

    array_point, array_vector = arrays

    point = Point(array_point)
    vector = Vector(array_vector)

    point_2 = point + array_vector
    assert math.isclose(point.distance_point(point_2), vector.norm())

    point_3 = point_2 - array_vector
    assert point.is_close(point_3)
Ejemplo n.º 2
0
def test_distance_points(array_a, array_b, dist_expected):

    point_a = Point(array_a)
    assert math.isclose(point_a.distance_point(array_b), dist_expected)