def test_ninety_degress_angle(self): v1 = Vector(0, 1, 0) v2 = Vector(1, 0, 0) expected = math.pi / 2 self.assertEqual(v1.angle_between(v2), expected)
def test_180_degrees(self): v1 = Vector(-1, 0, 0) v2 = Vector(1, 0, 0) self.assertEqual(v1.angle_between(v2), math.pi)
def test_angle_between(self): v1 = Vector(1, 2, 3) v2 = Vector(4, 5, 6) expected = 0.22572613 self.assertAlmostEqual(expected, v1.angle_between(v2), 8)