コード例 #1
0
ファイル: test_Quaternion.py プロジェクト: LeTEXIER/geotools
 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.)
コード例 #2
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.)
コード例 #3
0
ファイル: test_Quaternion.py プロジェクト: LeTEXIER/geotools
 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.)
コード例 #4
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.)
コード例 #5
0
ファイル: test_Quaternion.py プロジェクト: LeTEXIER/geotools
 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])
コード例 #6
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])