def test_dot_product_float_2d(self): v1 = Vector((7.887, 4.138)) v2 = Vector((-8.802, 6.776)) result = v1.dot_product(v2) result = round_float(result, 3) self.assertEqual(result, -41.382, 'dot product does not work')
def test_dot_product_float_3d(self): v1 = Vector((-5.955, -4.904, -1.874)) v2 = Vector((-4.496, -8.755, 7.103)) result = v1.dot_product(v2) result = round_float(result, 3) self.assertEqual(result, 56.397, 'dot product does not work')
def test_dot_product_simple(self): v1 = Vector((1, 2, -1)) v2 = Vector((3, 1, 0)) result = v1.dot_product(v2) self.assertEqual(result, 5, 'dot product does not work')