def test_imul(self): eq = self.assertAlmostEqual q1 = Quaternion.fromAngleAxis(math.radians(90.),Vector(0.,0.,1.)) q2 = Quaternion.fromAngleAxis(math.radians(-90.),Vector(0.,0.,1.)) q1 *= q2 eq(q1.w, 1.) eq(q1.x, 0.) eq(q1.y, 0.) eq(q1.z, 0.)
def test_imul(self): eq = self.assertAlmostEqual q1 = Quaternion.fromAngleAxis(math.radians(90.), Vector(0., 0., 1.)) q2 = Quaternion.fromAngleAxis(math.radians(-90.), Vector(0., 0., 1.)) q1 *= q2 eq(q1.w, 1.) eq(q1.x, 0.) eq(q1.y, 0.) eq(q1.z, 0.)
def test_imap(self): eq = self.assertAlmostEqual q = Quaternion.fromAngleAxis(math.radians(90.),Vector(0.,0.,1.)) p = q.imap((1.,0.,0.)) eq(p[0], 0.) eq(p[1], -1.) eq(p[2], 0.)
def test_imap(self): eq = self.assertAlmostEqual q = Quaternion.fromAngleAxis(math.radians(90.), Vector(0., 0., 1.)) p = q.imap((1., 0., 0.)) eq(p[0], 0.) eq(p[1], -1.) eq(p[2], 0.)
def test_transform(self): eq = self.assertAlmostEqual q = Quaternion.fromAngleAxis(math.radians(90.),Vector(0.,0.,1.)) a = q.map((1.,0.,0.)) tr = q.transform b = tr.map((1.,0.,0.)) eq(a[0], b[0]) eq(a[1], b[1]) eq(a[2], b[2])
def test_transform(self): eq = self.assertAlmostEqual q = Quaternion.fromAngleAxis(math.radians(90.), Vector(0., 0., 1.)) a = q.map((1., 0., 0.)) tr = q.transform b = tr.map((1., 0., 0.)) eq(a[0], b[0]) eq(a[1], b[1]) eq(a[2], b[2])