/[escript]/trunk/pycad/test/python/run_pycad_test.py
ViewVC logotype

Annotation of /trunk/pycad/test/python/run_pycad_test.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 907 - (hide annotations)
Wed Nov 22 09:54:19 2006 UTC (14 years, 4 months ago) by gross
File MIME type: text/x-python
File size: 38278 byte(s)
more testing for transformations added
1 gross 905 # $Id: run_visualization_interface.py 798 2006-08-04 01:05:36Z gross $
2    
3     __copyright__=""" Copyright (c) 2006 by ACcESS MNRF
4     http://www.access.edu.au
5     Primary Business: Queensland, Australia"""
6     __license__="""Licensed under the Open Software License version 3.0
7     http://www.opensource.org/licenses/osl-3.0.php"""
8     import sys
9     import unittest
10 gross 907 import math
11 gross 905 import numarray
12     from esys.pycad import *
13    
14     try:
15     PYCAD_TEST_DATA=os.environ['PYCAD_TEST_DATA']
16     except KeyError:
17     PYCAD_TEST_DATA='.'
18    
19     try:
20     PYCAD_WORKDIR=os.environ['PYCAD_WORKDIR']
21     except KeyError:
22     PYCAD_WORKDIR='.'
23    
24     PYCAD_TEST_MESH_PATH=PYCAD_TEST_DATA+"/data_meshes/"
25     PYCAD_WORKDIR_PATH=PYCAD_WORKDIR+"/"
26    
27 gross 907 def _cross(x, y):
28     return numarray.array([x[1] * y[2] - x[2] * y[1], x[2] * y[0] - x[0] * y[2], x[0] * y[1] - x[1] * y[0]])
29    
30    
31 gross 905 class Test_PyCAD(unittest.TestCase):
32     ABS_TOL=1.e-8
33     def __distance(self,x,y):
34     return math.sqrt(numarray.dot(x-y,x-y))
35     def test_Translation_x(self):
36     t=Translation([1,0,0])
37     s0=t([1,0,0])
38     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
39     self.failUnless(self.__distance(s0,numarray.array([2,0,0]))<self.ABS_TOL,"s0 is wrong.")
40     s1=t([0,1,0])
41     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
42     self.failUnless(self.__distance(s1,numarray.array([1,1,0]))<self.ABS_TOL,"s1 is wrong.")
43     s2=t([0,0,1])
44     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
45     self.failUnless(self.__distance(s2,numarray.array([1,0,1]))<self.ABS_TOL,"s2 is wrong.")
46     def test_Translation_y(self):
47     t=Translation([0,1,0])
48     s0=t([1,0,0])
49     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
50     self.failUnless(self.__distance(s0,numarray.array([1,1,0]))<self.ABS_TOL,"s0 is wrong.")
51     s1=t([0,1,0])
52     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
53     self.failUnless(self.__distance(s1,numarray.array([0,2,0]))<self.ABS_TOL,"s1 is wrong.")
54     s2=t([0,0,1])
55     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
56     self.failUnless(self.__distance(s2,numarray.array([0,1,1]))<self.ABS_TOL,"s2 is wrong.")
57     def test_Translation_z(self):
58     t=Translation([0,0,1])
59     s0=t([1,0,0])
60     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
61     self.failUnless(self.__distance(s0,numarray.array([1,0,1]))<self.ABS_TOL,"s0 is wrong.")
62     s1=t([0,1,0])
63     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
64     self.failUnless(self.__distance(s1,numarray.array([0,1,1]))<self.ABS_TOL,"s1 is wrong.")
65     s2=t([0,0,1])
66     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
67     self.failUnless(self.__distance(s2,numarray.array([0,0,2]))<self.ABS_TOL,"s2 is wrong.")
68     def test_Dilation_0_two(self):
69     t=Dilation(2.)
70     s0=t([1,0,0])
71     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
72     self.failUnless(self.__distance(s0,numarray.array([2,0,0]))<self.ABS_TOL,"s0 is wrong.")
73     s1=t([0,1,0])
74     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
75     self.failUnless(self.__distance(s1,numarray.array([0,2,0]))<self.ABS_TOL,"s1 is wrong.")
76     s2=t([0,0,1])
77     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
78     self.failUnless(self.__distance(s2,numarray.array([0,0,2]))<self.ABS_TOL,"s2 is wrong.")
79     def test_Dilation_0_half(self):
80     t=Dilation(0.5)
81     s0=t([1,0,0])
82     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
83     self.failUnless(self.__distance(s0,numarray.array([0.5,0,0]))<self.ABS_TOL,"s0 is wrong.")
84     s1=t([0,1,0])
85     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
86     self.failUnless(self.__distance(s1,numarray.array([0,0.5,0]))<self.ABS_TOL,"s1 is wrong.")
87     s2=t([0,0,1])
88     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
89     self.failUnless(self.__distance(s2,numarray.array([0,0,0.5]))<self.ABS_TOL,"s2 is wrong.")
90     def test_Dilation_x_two(self):
91     t=Dilation(2.,[1.,0.,0.])
92     s0=t([1,0,0])
93     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
94     self.failUnless(self.__distance(s0,numarray.array([1,0,0]))<self.ABS_TOL,"s0 is wrong.")
95     s0_1=t([0,0,0])
96     self.failUnless(isinstance(s0_1,numarray.NumArray),"s0_1 is not a numarray object.")
97     self.failUnless(self.__distance(s0_1,numarray.array([-1.,0,0]))<self.ABS_TOL,"s0_1 is wrong.")
98     s1=t([0,1,0])
99     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
100     self.failUnless(self.__distance(s1,numarray.array([-1,2,0]))<self.ABS_TOL,"s1 is wrong.")
101     s2=t([0,0,1])
102     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
103     self.failUnless(self.__distance(s2,numarray.array([-1.,0,2]))<self.ABS_TOL,"s2 is wrong.")
104     def test_Dilation_x_half(self):
105     t=Dilation(0.5,[1.,0.,0.])
106     s0=t([1,0,0])
107     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
108     self.failUnless(self.__distance(s0,numarray.array([1.,0,0]))<self.ABS_TOL,"s0 is wrong.")
109     s0_1=t([0,0,0])
110     self.failUnless(isinstance(s0_1,numarray.NumArray),"s0_1 is not a numarray object.")
111     self.failUnless(self.__distance(s0_1,numarray.array([.5,0,0]))<self.ABS_TOL,"s0_1 is wrong.")
112     s1=t([0,1,0])
113     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
114     self.failUnless(self.__distance(s1,numarray.array([0.5,0.5,0]))<self.ABS_TOL,"s1 is wrong.")
115     s2=t([0,0,1])
116     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
117     self.failUnless(self.__distance(s2,numarray.array([0.5,0,0.5]))<self.ABS_TOL,"s2 is wrong.")
118     def test_Dilation_y_two(self):
119     t=Dilation(2.,[0.,1.,0.])
120     s0=t([1,0,0])
121     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
122     self.failUnless(self.__distance(s0,numarray.array([2.,-1.,0]))<self.ABS_TOL,"s0 is wrong.")
123     s1_1=t([0,0,0])
124     self.failUnless(isinstance(s1_1,numarray.NumArray),"s1_1 is not a numarray object.")
125     self.failUnless(self.__distance(s1_1,numarray.array([0.,-1.,0]))<self.ABS_TOL,"s1_1 is wrong.")
126     s1=t([0,1,0])
127     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
128     self.failUnless(self.__distance(s1,numarray.array([0.,1.,0]))<self.ABS_TOL,"s1 is wrong.")
129     s2=t([0,0,1])
130     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
131     self.failUnless(self.__distance(s2,numarray.array([0.,-1.,2]))<self.ABS_TOL,"s2 is wrong.")
132     def test_Dilation_y_half(self):
133     t=Dilation(0.5,[0.,1.,0.])
134     s0=t([1,0,0])
135     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
136     self.failUnless(self.__distance(s0,numarray.array([0.5,0.5,0]))<self.ABS_TOL,"s0 is wrong.")
137     s1_1=t([0,0,0])
138     self.failUnless(isinstance(s1_1,numarray.NumArray),"s1_1 is not a numarray object.")
139     self.failUnless(self.__distance(s1_1,numarray.array([0,0.5,0]))<self.ABS_TOL,"s1_1 is wrong.")
140     s1=t([0,1,0])
141     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
142     self.failUnless(self.__distance(s1,numarray.array([0.,1.,0]))<self.ABS_TOL,"s1 is wrong.")
143     s2=t([0,0,1])
144     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
145     self.failUnless(self.__distance(s2,numarray.array([0.,0.5,0.5]))<self.ABS_TOL,"s2 is wrong.")
146     def test_Dilation_z_two(self):
147     t=Dilation(2.,[0.,0.,1.])
148     s0=t([1,0,0])
149     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
150     self.failUnless(self.__distance(s0,numarray.array([2.,0.,-1.]))<self.ABS_TOL,"s0 is wrong.")
151     s2_1=t([0,0,0])
152     self.failUnless(isinstance(s2_1,numarray.NumArray),"s2_1 is not a numarray object.")
153     self.failUnless(self.__distance(s2_1,numarray.array([0.,0.,-1.]))<self.ABS_TOL,"s2_1 is wrong.")
154     s1=t([0,1,0])
155     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
156     self.failUnless(self.__distance(s1,numarray.array([0.,2.,-1.]))<self.ABS_TOL,"s1 is wrong.")
157     s2=t([0,0,1])
158     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
159     self.failUnless(self.__distance(s2,numarray.array([0.,0.,1.]))<self.ABS_TOL,"s2 is wrong.")
160     def test_Dilation_z_half(self):
161     t=Dilation(0.5,[0.,0.,1.])
162     s0=t([1,0,0])
163     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
164     self.failUnless(self.__distance(s0,numarray.array([0.5,0.,0.5]))<self.ABS_TOL,"s0 is wrong.")
165     s2_1=t([0,0,0])
166     self.failUnless(isinstance(s2_1,numarray.NumArray),"s2_1 is not a numarray object.")
167     self.failUnless(self.__distance(s2_1,numarray.array([0,0,0.5]))<self.ABS_TOL,"s2_1 is wrong.")
168     s1=t([0,1,0])
169     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
170     self.failUnless(self.__distance(s1,numarray.array([0.,0.5,0.5]))<self.ABS_TOL,"s1 is wrong.")
171     s2=t([0,0,1])
172     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
173     self.failUnless(self.__distance(s2,numarray.array([0.,0.,1.]))<self.ABS_TOL,"s2 is wrong.")
174     def test_Reflection_x_offset0(self):
175     t=Reflection([1.,0.,0.])
176     s0=t([1,0,0])
177     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
178     self.failUnless(self.__distance(s0,numarray.array([-1.,0,0.]))<self.ABS_TOL,"s0 is wrong.")
179     s1=t([0,1,0])
180     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
181     self.failUnless(self.__distance(s1,numarray.array([0,1,0]))<self.ABS_TOL,"s1 is wrong.")
182     s2=t([0,0,1])
183     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
184     self.failUnless(self.__distance(s2,numarray.array([0,0,1]))<self.ABS_TOL,"s2 is wrong.")
185     s=t([1,2,3])
186     self.failUnless(isinstance(s,numarray.NumArray),"s is not a numarray object.")
187     self.failUnless(self.__distance(s,numarray.array([-1.,2,3]))<self.ABS_TOL,"s is wrong.")
188     def test_Reflection_x_offset2(self):
189     t=Reflection([-2.,0.,0.],offset=-4)
190     s0=t([1,0,0])
191     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
192     self.failUnless(self.__distance(s0,numarray.array([3.,0,0.]))<self.ABS_TOL,"s0 is wrong.")
193     s1=t([0,1,0])
194     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
195     self.failUnless(self.__distance(s1,numarray.array([4,1,0]))<self.ABS_TOL,"s1 is wrong.")
196     s2=t([0,0,1])
197     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
198     self.failUnless(self.__distance(s2,numarray.array([4,0,1]))<self.ABS_TOL,"s2 is wrong.")
199     s=t([1,2,3])
200     self.failUnless(isinstance(s,numarray.NumArray),"s is not a numarray object.")
201     self.failUnless(self.__distance(s,numarray.array([3.,2,3]))<self.ABS_TOL,"s is wrong.")
202     def test_Reflection_x_offset2_vector(self):
203     t=Reflection([1.,0.,0.],offset=[2,0,0])
204     s0=t([1,0,0])
205     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
206     self.failUnless(self.__distance(s0,numarray.array([3.,0,0.]))<self.ABS_TOL,"s0 is wrong.")
207     s1=t([0,1,0])
208     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
209     self.failUnless(self.__distance(s1,numarray.array([4,1,0]))<self.ABS_TOL,"s1 is wrong.")
210     s2=t([0,0,1])
211     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
212     self.failUnless(self.__distance(s2,numarray.array([4,0,1]))<self.ABS_TOL,"s2 is wrong.")
213     s=t([1,2,3])
214     self.failUnless(isinstance(s,numarray.NumArray),"s is not a numarray object.")
215     self.failUnless(self.__distance(s,numarray.array([3.,2,3]))<self.ABS_TOL,"s is wrong.")
216 gross 907 def test_Reflection_y_offset0(self):
217     t=Reflection([0.,1.,0.])
218     s0=t([1,0,0])
219     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
220     self.failUnless(self.__distance(s0,numarray.array([1.,0,0.]))<self.ABS_TOL,"s0 is wrong.")
221     s1=t([0,1,0])
222     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
223     self.failUnless(self.__distance(s1,numarray.array([0,-1,0]))<self.ABS_TOL,"s1 is wrong.")
224     s2=t([0,0,1])
225     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
226     self.failUnless(self.__distance(s2,numarray.array([0,0,1]))<self.ABS_TOL,"s2 is wrong.")
227     s=t([1,2,3])
228     self.failUnless(isinstance(s,numarray.NumArray),"s is not a numarray object.")
229     self.failUnless(self.__distance(s,numarray.array([1.,-2,3]))<self.ABS_TOL,"s is wrong.")
230     def test_Reflection_y_offset2(self):
231     t=Reflection([0.,-2.,0.],offset=-4)
232     s0=t([1,0,0])
233     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
234     self.failUnless(self.__distance(s0,numarray.array([1.,4,0.]))<self.ABS_TOL,"s0 is wrong.")
235     s1=t([0,1,0])
236     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
237     self.failUnless(self.__distance(s1,numarray.array([0,3,0]))<self.ABS_TOL,"s1 is wrong.")
238     s2=t([0,0,1])
239     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
240     self.failUnless(self.__distance(s2,numarray.array([0,4,1]))<self.ABS_TOL,"s2 is wrong.")
241     s=t([1,2,3])
242     self.failUnless(isinstance(s,numarray.NumArray),"s is not a numarray object.")
243     self.failUnless(self.__distance(s,numarray.array([1.,2,3]))<self.ABS_TOL,"s is wrong.")
244     def test_Reflection_y_offset2_vector(self):
245     t=Reflection([0.,1.,0.],offset=[0,2,0])
246     s0=t([1,0,0])
247     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
248     self.failUnless(self.__distance(s0,numarray.array([1.,4,0.]))<self.ABS_TOL,"s0 is wrong.")
249     s1=t([0,1,0])
250     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
251     self.failUnless(self.__distance(s1,numarray.array([0,3,0]))<self.ABS_TOL,"s1 is wrong.")
252     s2=t([0,0,1])
253     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
254     self.failUnless(self.__distance(s2,numarray.array([0,4,1]))<self.ABS_TOL,"s2 is wrong.")
255     s=t([1,2,3])
256     self.failUnless(isinstance(s,numarray.NumArray),"s is not a numarray object.")
257     self.failUnless(self.__distance(s,numarray.array([1.,2,3]))<self.ABS_TOL,"s is wrong.")
258     def test_Reflection_z_offset0(self):
259     t=Reflection([0.,0.,1.])
260     s0=t([1,0,0])
261     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
262     self.failUnless(self.__distance(s0,numarray.array([1.,0,0.]))<self.ABS_TOL,"s0 is wrong.")
263     s1=t([0,1,0])
264     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
265     self.failUnless(self.__distance(s1,numarray.array([0,1,0]))<self.ABS_TOL,"s1 is wrong.")
266     s2=t([0,0,1])
267     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
268     self.failUnless(self.__distance(s2,numarray.array([0,0,-1]))<self.ABS_TOL,"s2 is wrong.")
269     s=t([1,2,3])
270     self.failUnless(isinstance(s,numarray.NumArray),"s is not a numarray object.")
271     self.failUnless(self.__distance(s,numarray.array([1.,2,-3]))<self.ABS_TOL,"s is wrong.")
272     def test_Reflection_z_offset2(self):
273     t=Reflection([0.,0.,-2.],offset=-4)
274     s0=t([1,0,0])
275     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
276     self.failUnless(self.__distance(s0,numarray.array([1.,0,4.]))<self.ABS_TOL,"s0 is wrong.")
277     s1=t([0,1,0])
278     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
279     self.failUnless(self.__distance(s1,numarray.array([0,1,4]))<self.ABS_TOL,"s1 is wrong.")
280     s2=t([0,0,1])
281     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
282     self.failUnless(self.__distance(s2,numarray.array([0,0,3]))<self.ABS_TOL,"s2 is wrong.")
283     s=t([1,2,3])
284     self.failUnless(isinstance(s,numarray.NumArray),"s is not a numarray object.")
285     self.failUnless(self.__distance(s,numarray.array([1.,2,1]))<self.ABS_TOL,"s is wrong.")
286     def test_Reflection_z_offset2_vector(self):
287     t=Reflection([0.,0.,1.],offset=[0,0,2])
288     s0=t([1,0,0])
289     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
290     self.failUnless(self.__distance(s0,numarray.array([1.,0,4.]))<self.ABS_TOL,"s0 is wrong.")
291     s1=t([0,1,0])
292     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
293     self.failUnless(self.__distance(s1,numarray.array([0,1,4]))<self.ABS_TOL,"s1 is wrong.")
294     s2=t([0,0,1])
295     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
296     self.failUnless(self.__distance(s2,numarray.array([0,0,3]))<self.ABS_TOL,"s2 is wrong.")
297     s=t([1,2,3])
298     self.failUnless(isinstance(s,numarray.NumArray),"s is not a numarray object.")
299     self.failUnless(self.__distance(s,numarray.array([1.,2,1]))<self.ABS_TOL,"s is wrong.")
300     def test_Rotatation_x_90_0(self):
301     t=Rotatation(point1=[1.,0.,0.],angle=90*DEG)
302     s0=t([1,0,0])
303     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
304     self.failUnless(self.__distance(s0,numarray.array([1.,0,0.]))<self.ABS_TOL,"s0 is wrong.")
305     s1=t([0,1,0])
306     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
307     self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")
308     self.failUnless(abs(s1[1]-math.cos(90*DEG))<self.ABS_TOL,"s1 angle is wrong.")
309     self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([1.,0.,0.]))>0.,"s1 has wrong orientation.")
310     s2=t([0,0,1])
311     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
312     self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")
313     self.failUnless(abs(s2[2]-math.cos(90*DEG))<self.ABS_TOL,"s2 angle is wrong.")
314     self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([1.,0.,0.]))>0.,"s2 has wrong orientation.")
315     def test_Rotatation_x_30_0(self):
316     t=Rotatation(point1=[1.,0.,0.],angle=30*DEG)
317     s0=t([1,0,0])
318     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
319     self.failUnless(self.__distance(s0,numarray.array([1.,0,0.]))<self.ABS_TOL,"s0 is wrong.")
320     s1=t([0,1,0])
321     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
322     self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")
323     self.failUnless(abs(s1[1]-math.cos(30*DEG))<self.ABS_TOL,"s1 angle is wrong.")
324     self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([1.,0.,0.]))>0.,"s1 has wrong orientation.")
325     s2=t([0,0,1])
326     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
327     self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")
328     self.failUnless(abs(s2[2]-math.cos(30*DEG))<self.ABS_TOL,"s2 angle is wrong.")
329     self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([1.,0.,0.]))>0.,"s2 has wrong orientation.")
330     def test_Rotatation_x_330_0(self):
331     t=Rotatation(point1=[1.,0.,0.],angle=330*DEG)
332     s0=t([1,0,0])
333     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
334     self.failUnless(self.__distance(s0,numarray.array([1.,0,0.]))<self.ABS_TOL,"s0 is wrong.")
335     s1=t([0,1,0])
336     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
337     self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")
338     self.failUnless(abs(s1[1]-math.cos(330*DEG))<self.ABS_TOL,"s1 angle is wrong.")
339     self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([1.,0.,0.]))<0.,"s1 has wrong orientation.")
340     s2=t([0,0,1])
341     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
342     self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")
343     self.failUnless(abs(s2[2]-math.cos(330*DEG))<self.ABS_TOL,"s2 angle is wrong.")
344     self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([1.,0.,0.]))<0.,"s2 has wrong orientation.")
345     def test_Rotatation_x_90(self):
346     t=Rotatation(point1=[1.,0.,0.],point0=[2.,0.,0.],angle=90*DEG)
347     s0=t([1,0,0])
348     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
349     self.failUnless(self.__distance(s0,numarray.array([1.,0,0.]))<self.ABS_TOL,"s0 is wrong.")
350     s1=t([0,1,0])
351     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
352     self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")
353     self.failUnless(abs(s1[1]-math.cos(90*DEG))<self.ABS_TOL,"s1 angle is wrong.")
354     self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([-1.,0.,0.]))>0.,"s1 has wrong orientation.")
355     s2=t([0,0,1])
356     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
357     self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")
358     self.failUnless(abs(s2[2]-math.cos(90*DEG))<self.ABS_TOL,"s2 angle is wrong.")
359     self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([-1.,0.,0.]))>0.,"s2 has wrong orientation.")
360     def test_Rotatation_x_30(self):
361     t=Rotatation(point1=[1.,0.,0.],point0=[2.,0.,0.],angle=30*DEG)
362     s0=t([1,0,0])
363     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
364     self.failUnless(self.__distance(s0,numarray.array([1.,0,0.]))<self.ABS_TOL,"s0 is wrong.")
365     s1=t([0,1,0])
366     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
367     self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")
368     self.failUnless(abs(s1[1]-math.cos(30*DEG))<self.ABS_TOL,"s1 angle is wrong.")
369     self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([-1.,0.,0.]))>0.,"s1 has wrong orientation.")
370     s2=t([0,0,1])
371     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
372     self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")
373     self.failUnless(abs(s2[2]-math.cos(30*DEG))<self.ABS_TOL,"s2 angle is wrong.")
374     self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([-1.,0.,0.]))>0.,"s2 has wrong orientation.")
375     def test_Rotatation_x_330(self):
376     t=Rotatation(point1=[1.,0.,0.],point0=[2.,0.,0.],angle=330*DEG)
377     s0=t([1,0,0])
378     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
379     self.failUnless(self.__distance(s0,numarray.array([1.,0,0.]))<self.ABS_TOL,"s0 is wrong.")
380     s1=t([0,1,0])
381     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
382     self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")
383     self.failUnless(abs(s1[1]-math.cos(330*DEG))<self.ABS_TOL,"s1 angle is wrong.")
384     self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([-1.,0.,0.]))<0.,"s1 has wrong orientation.")
385     s2=t([0,0,1])
386     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
387     self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")
388     self.failUnless(abs(s2[2]-math.cos(330*DEG))<self.ABS_TOL,"s2 angle is wrong.")
389     self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([-1.,0.,0.]))<0.,"s2 has wrong orientation.")
390     def test_Rotatation_y_90_0(self):
391     t=Rotatation(point1=[0.,1.,0.],angle=90*DEG)
392     s0=t([1,0,0])
393     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
394     self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")
395     self.failUnless(abs(s0[0]-math.cos(90*DEG))<self.ABS_TOL,"s0 angle is wrong.")
396     self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,1.,0.]))>0.,"s0 has wrong orientation.")
397     s1=t([0,5,0])
398     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
399     self.failUnless(self.__distance(s1,numarray.array([0.,5,0.]))<self.ABS_TOL,"s1 is wrong.")
400     s2=t([0,0,1])
401     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
402     self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")
403     self.failUnless(abs(s2[2]-math.cos(90*DEG))<self.ABS_TOL,"s2 angle is wrong.")
404     self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([0.,1.,0.]))>0.,"s2 has wrong orientation.")
405     def test_Rotatation_y_30_0(self):
406     t=Rotatation(point1=[0.,1.,0.],angle=30*DEG)
407     s0=t([1,0,0])
408     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
409     self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")
410     self.failUnless(abs(s0[0]-math.cos(30*DEG))<self.ABS_TOL,"s0 angle is wrong.")
411     self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,1.,0.]))>0.,"s0 has wrong orientation.")
412     s1=t([0,5,0])
413     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
414     self.failUnless(self.__distance(s1,numarray.array([0.,5,0.]))<self.ABS_TOL,"s1 is wrong.")
415     s2=t([0,0,1])
416     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
417     self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")
418     self.failUnless(abs(s2[2]-math.cos(30*DEG))<self.ABS_TOL,"s2 angle is wrong.")
419     self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([0.,1.,0.]))>0.,"s2 has wrong orientation.")
420     def test_Rotatation_y_330_0(self):
421     t=Rotatation(point1=[0.,1.,0.],angle=330*DEG)
422     s0=t([1,0,0])
423     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
424     self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")
425     self.failUnless(abs(s0[0]-math.cos(330*DEG))<self.ABS_TOL,"s0 angle is wrong.")
426     self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,1.,0.]))<0.,"s0 has wrong orientation.")
427     s1=t([0,1,0])
428     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
429     self.failUnless(self.__distance(s1,numarray.array([0.,1,0.]))<self.ABS_TOL,"s1 is wrong.")
430     s2=t([0,0,1])
431     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
432     self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")
433     self.failUnless(abs(s2[2]-math.cos(330*DEG))<self.ABS_TOL,"s2 angle is wrong.")
434     self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([0.,1.,0.]))<0.,"s2 has wrong orientation.")
435     def test_Rotatation_y_90(self):
436     t=Rotatation(point1=[0.,1.,0.],point0=[0.,2.,0.],angle=90*DEG)
437     s0=t([1,0,0])
438     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
439     self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")
440     self.failUnless(abs(s0[0]-math.cos(90*DEG))<self.ABS_TOL,"s0 angle is wrong.")
441     self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,-1.,0.]))>0.,"s0 has wrong orientation.")
442     s1=t([0,1,0])
443     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
444     self.failUnless(self.__distance(s1,numarray.array([0.,1,0.]))<self.ABS_TOL,"s1 is wrong.")
445     s2=t([0,0,1])
446     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
447     self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")
448     self.failUnless(abs(s2[2]-math.cos(90*DEG))<self.ABS_TOL,"s2 angle is wrong.")
449     self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([0.,-1.,0.]))>0.,"s2 has wrong orientation.")
450     def test_Rotatation_y_30(self):
451     t=Rotatation(point1=[0.,1.,0.],point0=[0.,2.,0.],angle=30*DEG)
452     s0=t([1,0,0])
453     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
454     self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")
455     self.failUnless(abs(s0[0]-math.cos(30*DEG))<self.ABS_TOL,"s0 angle is wrong.")
456     self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,-1.,0.]))>0.,"s0 has wrong orientation.")
457     s1=t([0,1,0])
458     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
459     self.failUnless(self.__distance(s1,numarray.array([0.,1,0.]))<self.ABS_TOL,"s1 is wrong.")
460     s2=t([0,0,1])
461     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
462     self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")
463     self.failUnless(abs(s2[2]-math.cos(30*DEG))<self.ABS_TOL,"s2 angle is wrong.")
464     self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([0.,-1.,0.]))>0.,"s2 has wrong orientation.")
465     def test_Rotatation_y_330(self):
466     t=Rotatation(point1=[0.,1.,0.],point0=[0.,2.,0.],angle=330*DEG)
467     s0=t([1,0,0])
468     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
469     self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")
470     self.failUnless(abs(s0[0]-math.cos(330*DEG))<self.ABS_TOL,"s0 angle is wrong.")
471     self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,-1.,0.]))<0.,"s0 has wrong orientation.")
472     s1=t([0,1,0])
473     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
474     self.failUnless(self.__distance(s1,numarray.array([0.,1,0.]))<self.ABS_TOL,"s1 is wrong.")
475     s2=t([0,0,1])
476     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
477     self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")
478     self.failUnless(abs(s2[2]-math.cos(330*DEG))<self.ABS_TOL,"s2 angle is wrong.")
479     self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([0.,-1.,0.]))<0.,"s2 has wrong orientation.")
480     def test_Rotatation_z_90_0(self):
481     t=Rotatation(point1=[0.,0.,1.],angle=90*DEG)
482     s0=t([1,0,0])
483     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
484     self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")
485     self.failUnless(abs(s0[0]-math.cos(90*DEG))<self.ABS_TOL,"s0 angle is wrong.")
486     self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,0.,1.]))>0.,"s0 has wrong orientation.")
487     s1=t([0,5,0])
488     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
489     self.failUnless(abs(numarray.dot(s1,s1)-5.**2)<self.ABS_TOL,"s1 length is wrong.")
490     self.failUnless(abs(s1[1]/5.-math.cos(90*DEG))<self.ABS_TOL,"s1 angle is wrong.")
491     self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([0.,0.,1.]))>0.,"s1 has wrong orientation.")
492     s2=t([0,0,1])
493     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
494     self.failUnless(self.__distance(s2,numarray.array([0.,0,1.]))<self.ABS_TOL,"s2 is wrong.")
495     def test_Rotatation_z_30_0(self):
496     t=Rotatation(point1=[0.,0.,1.],angle=30*DEG)
497     s0=t([1,0,0])
498     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
499     self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")
500     self.failUnless(abs(s0[0]-math.cos(30*DEG))<self.ABS_TOL,"s0 angle is wrong.")
501     self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,0.,1.]))>0.,"s0 has wrong orientation.")
502     s1=t([0,5,0])
503     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
504     self.failUnless(abs(numarray.dot(s1,s1)-5.**2)<self.ABS_TOL,"s1 length is wrong.")
505     self.failUnless(abs(s1[1]/5.-math.cos(30*DEG))<self.ABS_TOL,"s1 angle is wrong.")
506     self.failUnless(numarray.dot(_cross(s1,[0,5,0]),numarray.array([0.,0.,1.]))>0.,"s1 has wrong orientation.")
507     s2=t([0,0,1])
508     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
509     self.failUnless(self.__distance(s2,numarray.array([0.,0,1.]))<self.ABS_TOL,"s2 is wrong.")
510     def test_Rotatation_z_330_0(self):
511     t=Rotatation(point1=[0.,0.,1.],angle=330*DEG)
512     s0=t([1,0,0])
513     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
514     self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")
515     self.failUnless(abs(s0[0]-math.cos(330*DEG))<self.ABS_TOL,"s0 angle is wrong.")
516     self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,0.,1.]))<0.,"s0 has wrong orientation.")
517     s1=t([0,5,0])
518     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
519     self.failUnless(abs(numarray.dot(s1,s1)-5.**2)<self.ABS_TOL,"s1 length is wrong.")
520     self.failUnless(abs(s1[1]/5.-math.cos(330*DEG))<self.ABS_TOL,"s1 angle is wrong.")
521     self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([0.,0.,1.]))<0.,"s1 has wrong orientation.")
522     def test_Rotatation_z_90(self):
523     t=Rotatation(point1=[0.,0.,1.],point0=[0.,0.,2.],angle=90*DEG)
524     s0=t([1,0,0])
525     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
526     self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")
527     self.failUnless(abs(s0[0]-math.cos(90*DEG))<self.ABS_TOL,"s0 angle is wrong.")
528     self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,0.,-1.]))>0.,"s0 has wrong orientation.")
529     s1=t([0,1,0])
530     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
531     self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")
532     self.failUnless(abs(s1[1]-math.cos(90*DEG))<self.ABS_TOL,"s1 angle is wrong.")
533     self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([0.,0.,-1.]))>0.,"s1 has wrong orientation.")
534     s2=t([0,0,1])
535     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
536     self.failUnless(self.__distance(s2,numarray.array([0.,0,1.]))<self.ABS_TOL,"s2 is wrong.")
537     def test_Rotatation_z_30(self):
538     t=Rotatation(point1=[0.,0.,1.],point0=[0.,0.,2.],angle=30*DEG)
539     s0=t([1,0,0])
540     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
541     self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")
542     self.failUnless(abs(s0[0]-math.cos(30*DEG))<self.ABS_TOL,"s0 angle is wrong.")
543     self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,0.,-1.]))>0.,"s0 has wrong orientation.")
544     s1=t([0,1,0])
545     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
546     self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")
547     self.failUnless(abs(s1[1]-math.cos(30*DEG))<self.ABS_TOL,"s1 angle is wrong.")
548     self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([0.,0.,-1.]))>0.,"s1 has wrong orientation.")
549     s2=t([0,0,1])
550     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
551     self.failUnless(self.__distance(s2,numarray.array([0.,0,1.]))<self.ABS_TOL,"s2 is wrong.")
552     def test_Rotatation_z_330(self):
553     t=Rotatation(point1=[0.,0.,1.],point0=[0.,0.,2.],angle=330*DEG)
554     s0=t([1,0,0])
555     self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
556     self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")
557     self.failUnless(abs(s0[0]-math.cos(330*DEG))<self.ABS_TOL,"s0 angle is wrong.")
558     self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,0.,-1.]))<0.,"s0 has wrong orientation.")
559     s1=t([0,1,0])
560     self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
561     self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")
562     self.failUnless(abs(s1[1]-math.cos(30*DEG))<self.ABS_TOL,"s1 angle is wrong.")
563     self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([0.,0.,-1.]))<0.,"s1 has wrong orientation.")
564     s2=t([0,0,1])
565     self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
566     self.failUnless(self.__distance(s2,numarray.array([0.,0,1.]))<self.ABS_TOL,"s2 is wrong.")
567 gross 905 if __name__ == '__main__':
568     suite = unittest.TestSuite()
569     suite.addTest(unittest.makeSuite(Test_PyCAD))
570     s=unittest.TextTestRunner(verbosity=2).run(suite)
571     if s.wasSuccessful():
572     sys.exit(0)
573     else:
574     sys.exit(1)

  ViewVC Help
Powered by ViewVC 1.1.26