From 352480ac14c8daa5509b269cdf67a6ee2baf3f18 Mon Sep 17 00:00:00 2001 From: David Moody Date: Fri, 24 Oct 2025 10:08:28 -0500 Subject: [PATCH] add test_dot_product to test_vector.py --- test/test_vector.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test_vector.py b/test/test_vector.py index 1f4ae0c..04d7304 100644 --- a/test/test_vector.py +++ b/test/test_vector.py @@ -10,3 +10,11 @@ class TestVector(unittest.TestCase): v3 = v1 + v2 self.assertIsInstance(v3, Vector) self.assertEqual(v3.x, v1.x + v2.x) + + def test_dot_product(self): + v1 = Vector(1, 2, 3) + v2 = Vector(-3, -2, -1) + v3 = v1.dot(v2) + self.assertEqual(v3,v1.x * v2.x + v1.y * v2.y + v1.z * v2.z) + vzero = Vector(0, 0, 0) + self.assertEqual(v1.dot(vzero),0)