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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 909 by gross, Wed Nov 22 09:54:19 2006 UTC revision 910 by gross, Fri Nov 24 10:04:09 2006 UTC
# Line 304  class Test_PyCAD(unittest.TestCase): Line 304  class Test_PyCAD(unittest.TestCase):
304          self.failUnless(self.__distance(s0,numarray.array([1.,0,0.]))<self.ABS_TOL,"s0 is wrong.")          self.failUnless(self.__distance(s0,numarray.array([1.,0,0.]))<self.ABS_TOL,"s0 is wrong.")
305          s1=t([0,1,0])          s1=t([0,1,0])
306          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")          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.")          self.failUnless(self.__distance(s1,numarray.array([0.,0,1.]))<self.ABS_TOL,"s1 is wrong.")
         self.failUnless(abs(s1[1]-math.cos(90*DEG))<self.ABS_TOL,"s1 angle is wrong.")  
         self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([1.,0.,0.]))>0.,"s1 has wrong orientation.")  
308          s2=t([0,0,1])          s2=t([0,0,1])
309          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
310          self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")          self.failUnless(self.__distance(s2,numarray.array([0.,-1.,0.]))<self.ABS_TOL,"s2 is wrong.")
         self.failUnless(abs(s2[2]-math.cos(90*DEG))<self.ABS_TOL,"s2 angle is wrong.")  
         self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([1.,0.,0.]))>0.,"s2 has wrong orientation.")  
311     def test_Rotatation_x_30_0(self):     def test_Rotatation_x_30_0(self):
312          t=Rotatation(point1=[1.,0.,0.],angle=30*DEG)          t=Rotatation(point1=[1.,0.,0.],angle=30*DEG)
313          s0=t([1,0,0])          s0=t([1,0,0])
# Line 321  class Test_PyCAD(unittest.TestCase): Line 317  class Test_PyCAD(unittest.TestCase):
317          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
318          self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")          self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")
319          self.failUnless(abs(s1[1]-math.cos(30*DEG))<self.ABS_TOL,"s1 angle is wrong.")          self.failUnless(abs(s1[1]-math.cos(30*DEG))<self.ABS_TOL,"s1 angle is wrong.")
320          self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([1.,0.,0.]))>0.,"s1 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([1.,0.,0.]))<0.,"s1 has wrong orientation.")
321          s2=t([0,0,1])          s2=t([0,0,1])
322          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
323          self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")          self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")
324          self.failUnless(abs(s2[2]-math.cos(30*DEG))<self.ABS_TOL,"s2 angle is wrong.")          self.failUnless(abs(s2[2]-math.cos(30*DEG))<self.ABS_TOL,"s2 angle is wrong.")
325          self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([1.,0.,0.]))>0.,"s2 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([1.,0.,0.]))<0.,"s2 has wrong orientation.")
326     def test_Rotatation_x_330_0(self):     def test_Rotatation_x_330_0(self):
327          t=Rotatation(point1=[1.,0.,0.],angle=330*DEG)          t=Rotatation(point1=[1.,0.,0.],angle=330*DEG)
328          s0=t([1,0,0])          s0=t([1,0,0])
# Line 336  class Test_PyCAD(unittest.TestCase): Line 332  class Test_PyCAD(unittest.TestCase):
332          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
333          self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")          self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")
334          self.failUnless(abs(s1[1]-math.cos(330*DEG))<self.ABS_TOL,"s1 angle is wrong.")          self.failUnless(abs(s1[1]-math.cos(330*DEG))<self.ABS_TOL,"s1 angle is wrong.")
335          self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([1.,0.,0.]))<0.,"s1 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([1.,0.,0.]))>0.,"s1 has wrong orientation.")
336          s2=t([0,0,1])          s2=t([0,0,1])
337          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
338          self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")          self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")
339          self.failUnless(abs(s2[2]-math.cos(330*DEG))<self.ABS_TOL,"s2 angle is wrong.")          self.failUnless(abs(s2[2]-math.cos(330*DEG))<self.ABS_TOL,"s2 angle is wrong.")
340          self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([1.,0.,0.]))<0.,"s2 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([1.,0.,0.]))>0.,"s2 has wrong orientation.")
341     def test_Rotatation_x_90(self):     def test_Rotatation_x_90(self):
342          t=Rotatation(point1=[1.,0.,0.],point0=[2.,0.,0.],angle=90*DEG)          t=Rotatation(point1=[1.,0.,0.],point0=[2.,0.,0.],angle=90*DEG)
343          s0=t([1,0,0])          s0=t([1,0,0])
# Line 349  class Test_PyCAD(unittest.TestCase): Line 345  class Test_PyCAD(unittest.TestCase):
345          self.failUnless(self.__distance(s0,numarray.array([1.,0,0.]))<self.ABS_TOL,"s0 is wrong.")          self.failUnless(self.__distance(s0,numarray.array([1.,0,0.]))<self.ABS_TOL,"s0 is wrong.")
346          s1=t([0,1,0])          s1=t([0,1,0])
347          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
348          self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")          self.failUnless(self.__distance(s1,numarray.array([0.,0,-1.]))<self.ABS_TOL,"s1 is wrong.")
         self.failUnless(abs(s1[1]-math.cos(90*DEG))<self.ABS_TOL,"s1 angle is wrong.")  
         self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([-1.,0.,0.]))>0.,"s1 has wrong orientation.")  
349          s2=t([0,0,1])          s2=t([0,0,1])
350          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
351          self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")          self.failUnless(self.__distance(s2,numarray.array([0.,1.,0.]))<self.ABS_TOL,"s2 is wrong.")
         self.failUnless(abs(s2[2]-math.cos(90*DEG))<self.ABS_TOL,"s2 angle is wrong.")  
         self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([-1.,0.,0.]))>0.,"s2 has wrong orientation.")  
352     def test_Rotatation_x_30(self):     def test_Rotatation_x_30(self):
353          t=Rotatation(point1=[1.,0.,0.],point0=[2.,0.,0.],angle=30*DEG)          t=Rotatation(point1=[1.,0.,0.],point0=[2.,0.,0.],angle=30*DEG)
354          s0=t([1,0,0])          s0=t([1,0,0])
# Line 366  class Test_PyCAD(unittest.TestCase): Line 358  class Test_PyCAD(unittest.TestCase):
358          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
359          self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")          self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")
360          self.failUnless(abs(s1[1]-math.cos(30*DEG))<self.ABS_TOL,"s1 angle is wrong.")          self.failUnless(abs(s1[1]-math.cos(30*DEG))<self.ABS_TOL,"s1 angle is wrong.")
361          self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([-1.,0.,0.]))>0.,"s1 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([-1.,0.,0.]))<0.,"s1 has wrong orientation.")
362          s2=t([0,0,1])          s2=t([0,0,1])
363          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
364          self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")          self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")
365          self.failUnless(abs(s2[2]-math.cos(30*DEG))<self.ABS_TOL,"s2 angle is wrong.")          self.failUnless(abs(s2[2]-math.cos(30*DEG))<self.ABS_TOL,"s2 angle is wrong.")
366          self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([-1.,0.,0.]))>0.,"s2 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([-1.,0.,0.]))<0.,"s2 has wrong orientation.")
367     def test_Rotatation_x_330(self):     def test_Rotatation_x_330(self):
368          t=Rotatation(point1=[1.,0.,0.],point0=[2.,0.,0.],angle=330*DEG)          t=Rotatation(point1=[1.,0.,0.],point0=[2.,0.,0.],angle=330*DEG)
369          s0=t([1,0,0])          s0=t([1,0,0])
# Line 381  class Test_PyCAD(unittest.TestCase): Line 373  class Test_PyCAD(unittest.TestCase):
373          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
374          self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")          self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")
375          self.failUnless(abs(s1[1]-math.cos(330*DEG))<self.ABS_TOL,"s1 angle is wrong.")          self.failUnless(abs(s1[1]-math.cos(330*DEG))<self.ABS_TOL,"s1 angle is wrong.")
376          self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([-1.,0.,0.]))<0.,"s1 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([-1.,0.,0.]))>0.,"s1 has wrong orientation.")
377          s2=t([0,0,1])          s2=t([0,0,1])
378          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
379          self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")          self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")
380          self.failUnless(abs(s2[2]-math.cos(330*DEG))<self.ABS_TOL,"s2 angle is wrong.")          self.failUnless(abs(s2[2]-math.cos(330*DEG))<self.ABS_TOL,"s2 angle is wrong.")
381          self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([-1.,0.,0.]))<0.,"s2 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([-1.,0.,0.]))>0.,"s2 has wrong orientation.")
382     def test_Rotatation_y_90_0(self):     def test_Rotatation_y_90_0(self):
383          t=Rotatation(point1=[0.,1.,0.],angle=90*DEG)          t=Rotatation(point1=[0.,1.,0.],angle=90*DEG)
384          s0=t([1,0,0])          s0=t([1,0,0])
385          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
386          self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")          self.failUnless(self.__distance(s0,numarray.array([0.,0,-1.]))<self.ABS_TOL,"s0 is wrong.")
         self.failUnless(abs(s0[0]-math.cos(90*DEG))<self.ABS_TOL,"s0 angle is wrong.")  
         self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,1.,0.]))>0.,"s0 has wrong orientation.")  
387          s1=t([0,5,0])          s1=t([0,5,0])
388          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
389          self.failUnless(self.__distance(s1,numarray.array([0.,5,0.]))<self.ABS_TOL,"s1 is wrong.")          self.failUnless(self.__distance(s1,numarray.array([0.,5,0.]))<self.ABS_TOL,"s1 is wrong.")
390          s2=t([0,0,1])          s2=t([0,0,1])
391          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
392          self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")          self.failUnless(self.__distance(s2,numarray.array([1,0.,0.]))<self.ABS_TOL,"s2 is wrong.")
         self.failUnless(abs(s2[2]-math.cos(90*DEG))<self.ABS_TOL,"s2 angle is wrong.")  
         self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([0.,1.,0.]))>0.,"s2 has wrong orientation.")  
393     def test_Rotatation_y_30_0(self):     def test_Rotatation_y_30_0(self):
394          t=Rotatation(point1=[0.,1.,0.],angle=30*DEG)          t=Rotatation(point1=[0.,1.,0.],angle=30*DEG)
395          s0=t([1,0,0])          s0=t([1,0,0])
396          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
397          self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")          self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")
398          self.failUnless(abs(s0[0]-math.cos(30*DEG))<self.ABS_TOL,"s0 angle is wrong.")          self.failUnless(abs(s0[0]-math.cos(30*DEG))<self.ABS_TOL,"s0 angle is wrong.")
399          self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,1.,0.]))>0.,"s0 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,1.,0.]))<0.,"s0 has wrong orientation.")
400          s1=t([0,5,0])          s1=t([0,5,0])
401          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
402          self.failUnless(self.__distance(s1,numarray.array([0.,5,0.]))<self.ABS_TOL,"s1 is wrong.")          self.failUnless(self.__distance(s1,numarray.array([0.,5,0.]))<self.ABS_TOL,"s1 is wrong.")
# Line 416  class Test_PyCAD(unittest.TestCase): Line 404  class Test_PyCAD(unittest.TestCase):
404          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
405          self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")          self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")
406          self.failUnless(abs(s2[2]-math.cos(30*DEG))<self.ABS_TOL,"s2 angle is wrong.")          self.failUnless(abs(s2[2]-math.cos(30*DEG))<self.ABS_TOL,"s2 angle is wrong.")
407          self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([0.,1.,0.]))>0.,"s2 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([0.,1.,0.]))<0.,"s2 has wrong orientation.")
408     def test_Rotatation_y_330_0(self):     def test_Rotatation_y_330_0(self):
409          t=Rotatation(point1=[0.,1.,0.],angle=330*DEG)          t=Rotatation(point1=[0.,1.,0.],angle=330*DEG)
410          s0=t([1,0,0])          s0=t([1,0,0])
411          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
412          self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")          self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")
413          self.failUnless(abs(s0[0]-math.cos(330*DEG))<self.ABS_TOL,"s0 angle is wrong.")          self.failUnless(abs(s0[0]-math.cos(330*DEG))<self.ABS_TOL,"s0 angle is wrong.")
414          self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,1.,0.]))<0.,"s0 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,1.,0.]))>0.,"s0 has wrong orientation.")
415          s1=t([0,1,0])          s1=t([0,1,0])
416          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
417          self.failUnless(self.__distance(s1,numarray.array([0.,1,0.]))<self.ABS_TOL,"s1 is wrong.")          self.failUnless(self.__distance(s1,numarray.array([0.,1,0.]))<self.ABS_TOL,"s1 is wrong.")
# Line 431  class Test_PyCAD(unittest.TestCase): Line 419  class Test_PyCAD(unittest.TestCase):
419          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
420          self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")          self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")
421          self.failUnless(abs(s2[2]-math.cos(330*DEG))<self.ABS_TOL,"s2 angle is wrong.")          self.failUnless(abs(s2[2]-math.cos(330*DEG))<self.ABS_TOL,"s2 angle is wrong.")
422          self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([0.,1.,0.]))<0.,"s2 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([0.,1.,0.]))>0.,"s2 has wrong orientation.")
423     def test_Rotatation_y_90(self):     def test_Rotatation_y_90(self):
424          t=Rotatation(point1=[0.,1.,0.],point0=[0.,2.,0.],angle=90*DEG)          t=Rotatation(point1=[0.,1.,0.],point0=[0.,2.,0.],angle=90*DEG)
425          s0=t([1,0,0])          s0=t([1,0,0])
426          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
427          self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")          self.failUnless(self.__distance(s0,numarray.array([0.,0,1.]))<self.ABS_TOL,"s0 is wrong.")
428          self.failUnless(abs(s0[0]-math.cos(90*DEG))<self.ABS_TOL,"s0 angle is wrong.")          s1=t([0,5,0])
         self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,-1.,0.]))>0.,"s0 has wrong orientation.")  
         s1=t([0,1,0])  
429          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
430          self.failUnless(self.__distance(s1,numarray.array([0.,1,0.]))<self.ABS_TOL,"s1 is wrong.")          self.failUnless(self.__distance(s1,numarray.array([0.,5,0.]))<self.ABS_TOL,"s1 is wrong.")
431          s2=t([0,0,1])          s2=t([0,0,1])
432          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
433          self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")          self.failUnless(self.__distance(s2,numarray.array([-1,0.,0.]))<self.ABS_TOL,"s2 is wrong.")
         self.failUnless(abs(s2[2]-math.cos(90*DEG))<self.ABS_TOL,"s2 angle is wrong.")  
         self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([0.,-1.,0.]))>0.,"s2 has wrong orientation.")  
434     def test_Rotatation_y_30(self):     def test_Rotatation_y_30(self):
435          t=Rotatation(point1=[0.,1.,0.],point0=[0.,2.,0.],angle=30*DEG)          t=Rotatation(point1=[0.,1.,0.],point0=[0.,2.,0.],angle=30*DEG)
436          s0=t([1,0,0])          s0=t([1,0,0])
437          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
438          self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")          self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")
439          self.failUnless(abs(s0[0]-math.cos(30*DEG))<self.ABS_TOL,"s0 angle is wrong.")          self.failUnless(abs(s0[0]-math.cos(30*DEG))<self.ABS_TOL,"s0 angle is wrong.")
440          self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,-1.,0.]))>0.,"s0 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,-1.,0.]))<0.,"s0 has wrong orientation.")
441          s1=t([0,1,0])          s1=t([0,1,0])
442          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
443          self.failUnless(self.__distance(s1,numarray.array([0.,1,0.]))<self.ABS_TOL,"s1 is wrong.")          self.failUnless(self.__distance(s1,numarray.array([0.,1,0.]))<self.ABS_TOL,"s1 is wrong.")
# Line 461  class Test_PyCAD(unittest.TestCase): Line 445  class Test_PyCAD(unittest.TestCase):
445          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
446          self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")          self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")
447          self.failUnless(abs(s2[2]-math.cos(30*DEG))<self.ABS_TOL,"s2 angle is wrong.")          self.failUnless(abs(s2[2]-math.cos(30*DEG))<self.ABS_TOL,"s2 angle is wrong.")
448          self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([0.,-1.,0.]))>0.,"s2 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([0.,-1.,0.]))<0.,"s2 has wrong orientation.")
449     def test_Rotatation_y_330(self):     def test_Rotatation_y_330(self):
450          t=Rotatation(point1=[0.,1.,0.],point0=[0.,2.,0.],angle=330*DEG)          t=Rotatation(point1=[0.,1.,0.],point0=[0.,2.,0.],angle=330*DEG)
451          s0=t([1,0,0])          s0=t([1,0,0])
452          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
453          self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")          self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")
454          self.failUnless(abs(s0[0]-math.cos(330*DEG))<self.ABS_TOL,"s0 angle is wrong.")          self.failUnless(abs(s0[0]-math.cos(330*DEG))<self.ABS_TOL,"s0 angle is wrong.")
455          self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,-1.,0.]))<0.,"s0 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,-1.,0.]))>0.,"s0 has wrong orientation.")
456          s1=t([0,1,0])          s1=t([0,1,0])
457          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
458          self.failUnless(self.__distance(s1,numarray.array([0.,1,0.]))<self.ABS_TOL,"s1 is wrong.")          self.failUnless(self.__distance(s1,numarray.array([0.,1,0.]))<self.ABS_TOL,"s1 is wrong.")
# Line 476  class Test_PyCAD(unittest.TestCase): Line 460  class Test_PyCAD(unittest.TestCase):
460          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
461          self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")          self.failUnless(abs(numarray.dot(s2,s2)-1.)<self.ABS_TOL,"s2 length is wrong.")
462          self.failUnless(abs(s2[2]-math.cos(330*DEG))<self.ABS_TOL,"s2 angle is wrong.")          self.failUnless(abs(s2[2]-math.cos(330*DEG))<self.ABS_TOL,"s2 angle is wrong.")
463          self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([0.,-1.,0.]))<0.,"s2 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s2,[0,0,1]),numarray.array([0.,-1.,0.]))>0.,"s2 has wrong orientation.")
464     def test_Rotatation_z_90_0(self):     def test_Rotatation_z_90_0(self):
465          t=Rotatation(point1=[0.,0.,1.],angle=90*DEG)          t=Rotatation(point1=[0.,0.,1.],angle=90*DEG)
466          s0=t([1,0,0])          s0=t([1,0,0])
467          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
468          self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")          self.failUnless(self.__distance(s0,numarray.array([0.,1,0.]))<self.ABS_TOL,"s0 is wrong.")
         self.failUnless(abs(s0[0]-math.cos(90*DEG))<self.ABS_TOL,"s0 angle is wrong.")  
         self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,0.,1.]))>0.,"s0 has wrong orientation.")  
469          s1=t([0,5,0])          s1=t([0,5,0])
470          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
471          self.failUnless(abs(numarray.dot(s1,s1)-5.**2)<self.ABS_TOL,"s1 length is wrong.")          self.failUnless(self.__distance(s1,numarray.array([-5.,0,0.]))<self.ABS_TOL,"s1 is wrong.")
         self.failUnless(abs(s1[1]/5.-math.cos(90*DEG))<self.ABS_TOL,"s1 angle is wrong.")  
         self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([0.,0.,1.]))>0.,"s1 has wrong orientation.")  
472          s2=t([0,0,1])          s2=t([0,0,1])
473          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
474          self.failUnless(self.__distance(s2,numarray.array([0.,0,1.]))<self.ABS_TOL,"s2 is wrong.")          self.failUnless(self.__distance(s2,numarray.array([0.,0,1.]))<self.ABS_TOL,"s2 is wrong.")
# Line 498  class Test_PyCAD(unittest.TestCase): Line 478  class Test_PyCAD(unittest.TestCase):
478          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
479          self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")          self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")
480          self.failUnless(abs(s0[0]-math.cos(30*DEG))<self.ABS_TOL,"s0 angle is wrong.")          self.failUnless(abs(s0[0]-math.cos(30*DEG))<self.ABS_TOL,"s0 angle is wrong.")
481          self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,0.,1.]))>0.,"s0 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,0.,1.]))<0.,"s0 has wrong orientation.")
482          s1=t([0,5,0])          s1=t([0,5,0])
483          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
484          self.failUnless(abs(numarray.dot(s1,s1)-5.**2)<self.ABS_TOL,"s1 length is wrong.")          self.failUnless(abs(numarray.dot(s1,s1)-5.**2)<self.ABS_TOL,"s1 length is wrong.")
485          self.failUnless(abs(s1[1]/5.-math.cos(30*DEG))<self.ABS_TOL,"s1 angle is wrong.")          self.failUnless(abs(s1[1]/5.-math.cos(30*DEG))<self.ABS_TOL,"s1 angle is wrong.")
486          self.failUnless(numarray.dot(_cross(s1,[0,5,0]),numarray.array([0.,0.,1.]))>0.,"s1 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s1,[0,5,0]),numarray.array([0.,0.,1.]))<0.,"s1 has wrong orientation.")
487          s2=t([0,0,1])          s2=t([0,0,1])
488          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
489          self.failUnless(self.__distance(s2,numarray.array([0.,0,1.]))<self.ABS_TOL,"s2 is wrong.")          self.failUnless(self.__distance(s2,numarray.array([0.,0,1.]))<self.ABS_TOL,"s2 is wrong.")
# Line 513  class Test_PyCAD(unittest.TestCase): Line 493  class Test_PyCAD(unittest.TestCase):
493          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
494          self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")          self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")
495          self.failUnless(abs(s0[0]-math.cos(330*DEG))<self.ABS_TOL,"s0 angle is wrong.")          self.failUnless(abs(s0[0]-math.cos(330*DEG))<self.ABS_TOL,"s0 angle is wrong.")
496          self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,0.,1.]))<0.,"s0 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,0.,1.]))>0.,"s0 has wrong orientation.")
497          s1=t([0,5,0])          s1=t([0,5,0])
498          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
499          self.failUnless(abs(numarray.dot(s1,s1)-5.**2)<self.ABS_TOL,"s1 length is wrong.")          self.failUnless(abs(numarray.dot(s1,s1)-5.**2)<self.ABS_TOL,"s1 length is wrong.")
500          self.failUnless(abs(s1[1]/5.-math.cos(330*DEG))<self.ABS_TOL,"s1 angle is wrong.")          self.failUnless(abs(s1[1]/5.-math.cos(330*DEG))<self.ABS_TOL,"s1 angle is wrong.")
501          self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([0.,0.,1.]))<0.,"s1 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([0.,0.,1.]))>0.,"s1 has wrong orientation.")
502     def test_Rotatation_z_90(self):     def test_Rotatation_z_90(self):
503          t=Rotatation(point1=[0.,0.,1.],point0=[0.,0.,2.],angle=90*DEG)          t=Rotatation(point1=[0.,0.,1.],point0=[0.,0.,2.],angle=90*DEG)
504          s0=t([1,0,0])          s0=t([1,0,0])
505          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
506          self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")          self.failUnless(self.__distance(s0,numarray.array([0.,-1,0.]))<self.ABS_TOL,"s0 is wrong.")
507          self.failUnless(abs(s0[0]-math.cos(90*DEG))<self.ABS_TOL,"s0 angle is wrong.")          s1=t([0,5,0])
         self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,0.,-1.]))>0.,"s0 has wrong orientation.")  
         s1=t([0,1,0])  
508          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
509          self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")          self.failUnless(self.__distance(s1,numarray.array([5.,0,0.]))<self.ABS_TOL,"s1 is wrong.")
         self.failUnless(abs(s1[1]-math.cos(90*DEG))<self.ABS_TOL,"s1 angle is wrong.")  
         self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([0.,0.,-1.]))>0.,"s1 has wrong orientation.")  
510          s2=t([0,0,1])          s2=t([0,0,1])
511          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
512          self.failUnless(self.__distance(s2,numarray.array([0.,0,1.]))<self.ABS_TOL,"s2 is wrong.")          self.failUnless(self.__distance(s2,numarray.array([0.,0,1.]))<self.ABS_TOL,"s2 is wrong.")
# Line 540  class Test_PyCAD(unittest.TestCase): Line 516  class Test_PyCAD(unittest.TestCase):
516          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
517          self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")          self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")
518          self.failUnless(abs(s0[0]-math.cos(30*DEG))<self.ABS_TOL,"s0 angle is wrong.")          self.failUnless(abs(s0[0]-math.cos(30*DEG))<self.ABS_TOL,"s0 angle is wrong.")
519          self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,0.,-1.]))>0.,"s0 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,0.,-1.]))<0.,"s0 has wrong orientation.")
520          s1=t([0,1,0])          s1=t([0,1,0])
521          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
522          self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")          self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")
523          self.failUnless(abs(s1[1]-math.cos(30*DEG))<self.ABS_TOL,"s1 angle is wrong.")          self.failUnless(abs(s1[1]-math.cos(30*DEG))<self.ABS_TOL,"s1 angle is wrong.")
524          self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([0.,0.,-1.]))>0.,"s1 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([0.,0.,-1.]))<0.,"s1 has wrong orientation.")
525          s2=t([0,0,1])          s2=t([0,0,1])
526          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
527          self.failUnless(self.__distance(s2,numarray.array([0.,0,1.]))<self.ABS_TOL,"s2 is wrong.")          self.failUnless(self.__distance(s2,numarray.array([0.,0,1.]))<self.ABS_TOL,"s2 is wrong.")
# Line 555  class Test_PyCAD(unittest.TestCase): Line 531  class Test_PyCAD(unittest.TestCase):
531          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")          self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
532          self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")          self.failUnless(abs(numarray.dot(s0,s0)-1.)<self.ABS_TOL,"s0 length is wrong.")
533          self.failUnless(abs(s0[0]-math.cos(330*DEG))<self.ABS_TOL,"s0 angle is wrong.")          self.failUnless(abs(s0[0]-math.cos(330*DEG))<self.ABS_TOL,"s0 angle is wrong.")
534          self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,0.,-1.]))<0.,"s0 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s0,[1,0,0]),numarray.array([0.,0.,-1.]))>0.,"s0 has wrong orientation.")
535          s1=t([0,1,0])          s1=t([0,1,0])
536          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")          self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
537          self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")          self.failUnless(abs(numarray.dot(s1,s1)-1.)<self.ABS_TOL,"s1 length is wrong.")
538          self.failUnless(abs(s1[1]-math.cos(30*DEG))<self.ABS_TOL,"s1 angle is wrong.")          self.failUnless(abs(s1[1]-math.cos(30*DEG))<self.ABS_TOL,"s1 angle is wrong.")
539          self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([0.,0.,-1.]))<0.,"s1 has wrong orientation.")          self.failUnless(numarray.dot(_cross(s1,[0,1,0]),numarray.array([0.,0.,-1.]))>0.,"s1 has wrong orientation.")
540            s2=t([0,0,1])
541            self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
542            self.failUnless(self.__distance(s2,numarray.array([0.,0,1.]))<self.ABS_TOL,"s2 is wrong.")
543       def test_Rotatation_x_90_1(self):
544            t=Rotatation(point0=[0.,0.,1.],point1=[1.,0.,1.],angle=90*DEG)
545            s0=t([1,0,0])
546            self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
547            self.failUnless(self.__distance(s0,numarray.array([1.,1,1.]))<self.ABS_TOL,"s0 is wrong.")
548            s1=t([0,1,0])
549            self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
550            self.failUnless(self.__distance(s1,numarray.array([0.,1,2.]))<self.ABS_TOL,"s1 is wrong.")
551          s2=t([0,0,1])          s2=t([0,0,1])
552          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")          self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
553          self.failUnless(self.__distance(s2,numarray.array([0.,0,1.]))<self.ABS_TOL,"s2 is wrong.")          self.failUnless(self.__distance(s2,numarray.array([0.,0,1.]))<self.ABS_TOL,"s2 is wrong.")
554       def test_Rotatation_y_90_1(self):
555            t=Rotatation(point0=[1.,0.,0.],point1=[1.,1.,0.],angle=90*DEG)
556            s0=t([1,0,0])
557            self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
558            self.failUnless(self.__distance(s0,numarray.array([1.,0,0.]))<self.ABS_TOL,"s0 is wrong.")
559            s1=t([0,1,0])
560            self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
561            self.failUnless(self.__distance(s1,numarray.array([1.,1,1.]))<self.ABS_TOL,"s1 is wrong.")
562            s2=t([0,0,1])
563            self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
564            self.failUnless(self.__distance(s2,numarray.array([2.,0,1.]))<self.ABS_TOL,"s2 is wrong.")
565       def test_Rotatation_z_90_1(self):
566            t=Rotatation(point0=[0.,1.,0.],point1=[0.,1.,1.],angle=90*DEG)
567            s0=t([1,0,0])
568            self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
569            self.failUnless(self.__distance(s0,numarray.array([1.,2,0.]))<self.ABS_TOL,"s0 is wrong.")
570            s1=t([0,1,0])
571            self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
572            self.failUnless(self.__distance(s1,numarray.array([0.,1,0.]))<self.ABS_TOL,"s1 is wrong.")
573            s2=t([0,0,1])
574            self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
575            self.failUnless(self.__distance(s2,numarray.array([1.,1,1.]))<self.ABS_TOL,"s2 is wrong.")
576       def test_Rotatation_diag_90_0(self):
577            t=Rotatation(point1=[1.,1.,1.],angle=90*DEG)
578            s0=t([1,-1,0])
579            self.failUnless(isinstance(s0,numarray.NumArray),"s0 is not a numarray object.")
580            self.failUnless(abs(numarray.dot(s0,s0)-2.)<self.ABS_TOL,"s0 length is wrong.")
581            self.failUnless(abs(numarray.dot(s0,numarray.array([1,-1,0])))<self.ABS_TOL,"s0 angle is wrong.")
582            self.failUnless(numarray.dot(_cross(s0,[1,-1,0]),numarray.array([1.,1.,1.]))<0.,"s0 has wrong orientation.")
583            s1=t([0,1,-1])
584            self.failUnless(isinstance(s1,numarray.NumArray),"s1 is not a numarray object.")
585            self.failUnless(abs(numarray.dot(s1,s1)-2.)<self.ABS_TOL,"s1 length is wrong.")
586            self.failUnless(abs(numarray.dot(s1,numarray.array([0,1,-1])))<self.ABS_TOL,"s1 angle is wrong.")
587            self.failUnless(numarray.dot(_cross(s1,[0,1,-1]),numarray.array([1.,1.,1.]))<0.,"s1 has wrong orientation.")
588            s2=t([-1,0,1])
589            self.failUnless(isinstance(s2,numarray.NumArray),"s2 is not a numarray object.")
590            self.failUnless(abs(numarray.dot(s2,s2)-2.)<self.ABS_TOL,"s2 length is wrong.")
591            self.failUnless(abs(numarray.dot(s2,numarray.array([-1,0,1])))<self.ABS_TOL,"s2 angle is wrong.")
592            self.failUnless(numarray.dot(_cross(s2,[-1,0,1]),numarray.array([1.,1.,1.]))<0.,"s2 has wrong orientation.")
593            s3=t([1,1,1])
594            self.failUnless(isinstance(s3,numarray.NumArray),"s3 is not a numarray object.")
595            self.failUnless(self.__distance(s3,numarray.array([1.,1,1.]))<self.ABS_TOL,"s3 is wrong.")
596  if __name__ == '__main__':  if __name__ == '__main__':
597     suite = unittest.TestSuite()     suite = unittest.TestSuite()
598     suite.addTest(unittest.makeSuite(Test_PyCAD))     suite.addTest(unittest.makeSuite(Test_PyCAD))

Legend:
Removed from v.909  
changed lines
  Added in v.910

  ViewVC Help
Powered by ViewVC 1.1.26