예제 #1
0
 def test_applyQuaternion04(self):
     """applyQuaternion04  -- random pts 360 about random-axis"""
     state = StateToCoords(self.random_points, tolist=1)
     q = RandomArray.uniform(self.min, self.max, (4, ))
     q[3] = 360.0
     result = state.applyQuaternion(q)
     self.assertArrayEqual(self.random_points, result)
예제 #2
0
 def test_applyQuaternion05(self):
     """applyQuaternion05  -- random pts 3*120 about x-axis"""
     state = StateToCoords(self.random_points, tolist=1)
     q = (0.0, 0.0, 1.0, 120.0)
     for n in range(3):
         result = state.applyQuaternion(q)
     self.assertArrayEqual(self.random_points, result, 0)
 def test_applyQuaternion05(self):
     """applyQuaternion05  -- random pts 3*120 about x-axis"""
     state = StateToCoords(self.random_points, tolist=1)
     q = (0.0, 0.0, 1.0, 120.0)
     for n in xrange(3):
         result = state.applyQuaternion(q)
     self.assertArrayEqual(self.random_points, result,0)
 def test_applyQuaternion04(self):
     """applyQuaternion04  -- random pts 360 about random-axis"""
     state = StateToCoords(self.random_points, tolist=1)
     q = RandomArray.uniform(self.min, self.max, (4,))
     q[3] = 360.0
     result = state.applyQuaternion(q)
     self.assertArrayEqual(self.random_points, result)
예제 #5
0
 def test_applyQuaternion06(self):
     """applyQuaternion06  -- random pts 2*180 about random-axis"""
     state = StateToCoords(self.random_points, tolist=1)
     q = RandomArray.uniform(self.min, self.max, (4, ))
     q[3] = 180.0
     for n in range(2):
         result = state.applyQuaternion(q)
     self.assertArrayEqual(self.random_points, result)
예제 #6
0
 def test_applyQuaternion03(self):
     """applyQuaternion02  -- known pts  90 about z-axis"""
     state = StateToCoords(self.known_points, tolist=1)
     result = state.applyQuaternion((0.0, 0.0, 1.0, 90.0))
     expected = [[0., 1., 2.], [0., 1., 1.], [-1., 1., 1.], [0., 0., 1.],
                 [0., 0., 0.], [-1., 0., 0.], [-1., 0., -1.],
                 [-1., 1., -1.], [-2., 1., -1.], [-1., 1., -2.]]
     self.assertArrayEqual(expected, result)
예제 #7
0
 def test_applyQuaternion021(self):
     """applyQuaternion021 -- known pts  90 about x-axis; origin(1., 0., 1.)"""
     state = StateToCoords(self.known_points, tolist=1)
     result = state.applyQuaternion((1.0, 0.0, 0.0, 90.0), (1., 0., 1.))
     expected = [[1., -1., 1.], [1., 0., 1.], [1., 0., 2.], [0., 0., 1.],
                 [0., 1., 1.], [0., 1., 2.], [0., 2., 2.], [1., 2., 2.],
                 [1., 2., 3.], [1., 3., 2.]]
     self.assertArrayEqual(expected, result)
 def test_applyQuaternion06(self):
     """applyQuaternion06  -- random pts 2*180 about random-axis"""
     state = StateToCoords(self.random_points, tolist=1)
     q = RandomArray.uniform(self.min, self.max, (4,))
     q[3] = 180.0
     for n in xrange(2):
         result = state.applyQuaternion(q)
     self.assertArrayEqual(self.random_points, result)
 def test_applyQuaternion03(self):
     """applyQuaternion02  -- known pts  90 about z-axis"""
     state = StateToCoords(self.known_points, tolist=1)
     result = state.applyQuaternion((0.0, 0.0, 1.0, 90.0))
     expected = [[ 0.,  1., 2.],
                 [ 0.,  1., 1.],
                 [-1.,  1., 1.],
                 [ 0.,  0., 1.],
                 [ 0.,  0., 0.],
                 [-1.,  0., 0.],
                 [-1.,  0., -1.],
                 [-1.,  1., -1.],
                 [-2.,  1., -1.],
                 [-1.,  1., -2.]]
     self.assertArrayEqual(expected, result)
 def test_applyQuaternion021(self):
     """applyQuaternion021 -- known pts  90 about x-axis; origin(1., 0., 1.)"""
     state = StateToCoords(self.known_points, tolist=1)
     result = state.applyQuaternion((1.0, 0.0, 0.0, 90.0), (1., 0., 1.))
     expected = [[1., -1., 1.],
                 [1.,  0., 1.],
                 [1.,  0., 2.],
                 [0.,  0., 1.],
                 [0.,  1., 1.],
                 [0.,  1., 2.],
                 [0.,  2., 2.],
                 [1.,  2., 2.],
                 [1.,  2., 3.],
                 [1.,  3., 2.]]
     self.assertArrayEqual(expected, result)
예제 #11
0
 def test_applyQuaternion01(self):
     """applyQuaternion01  -- known pts 360 about x-axis"""
     state = StateToCoords(self.known_points, tolist=1)
     result = state.applyQuaternion((1.0, 0.0, 0.0, 360.0))
     self.assertArrayEqual(self.known_points, result)
 def test_applyQuaternion01(self):
     """applyQuaternion01  -- known pts 360 about x-axis"""
     state = StateToCoords(self.known_points, tolist=1)
     result = state.applyQuaternion((1.0, 0.0, 0.0, 360.0))
     self.assertArrayEqual(self.known_points, result)