def test_ops(self): self.assertEqual(math.dot(Vector2(0.5, 3.0), Vector2(2.0, 0.5)), 2.5) self.assertEqual(Deg(math.angle( Vector2(0.5, 3.0).normalized(), Vector2(2.0, 0.5).normalized())), Deg(66.5014333443446)) self.assertEqual(Vector3(1.0, 2.0, 0.3).projected(Vector3.y_axis()), Vector3.y_axis(2.0)) self.assertEqual(Vector3(1.0, 2.0, 0.3).projected_onto_normalized(Vector3.y_axis()), Vector3.y_axis(2.0))
def test_functions(self): a = math.angle(Quaterniond.rotation(Deg(45.0), Vector3d.x_axis()), Quaterniond.rotation(Deg(75.0), Vector3d.x_axis())) self.assertEqual(Deg(a), Deg(15.0))