/[escript]/trunk/pycad/py_src/transformations.py
ViewVC logotype

Diff of /trunk/pycad/py_src/transformations.py

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

revision 907 by gross, Wed Nov 22 09:54:19 2006 UTC revision 915 by gross, Thu Dec 14 06:12:53 2006 UTC
# Line 84  class Rotatation(Transformation): Line 84  class Rotatation(Transformation):
84         lz_per=numarray.dot(z_per,z_per)         lz_per=numarray.dot(z_per,z_per)
85         if lz_per>0:         if lz_per>0:
86           axis1=z_per/math.sqrt(lz_per)           axis1=z_per/math.sqrt(lz_per)
87           axis2=_cross(self.__axis,axis1)           axis2=_cross(axis1,self.__axis)
88           lax2=numarray.dot(axis2,axis2)           lax2=numarray.dot(axis2,axis2)
89           axis2/=math.sqrt(lax2)           if lax2>0:
90           return z0*self.__axis+math.sqrt(lz_per)*(math.cos(self.__angle)*axis1-math.sin(self.__angle)*axis2)+self.__point0              axis2/=math.sqrt(lax2)
91                return z0*self.__axis+math.sqrt(lz_per)*(math.cos(self.__angle)*axis1-math.sin(self.__angle)*axis2)+self.__point0
92             else:
93                return x
94         else:         else:
95           return x           return x
96  def _cross(x, y):  def _cross(x, y):
# Line 104  class Dilation(Transformation): Line 107  class Dilation(Transformation):
107         """         """
108         creates a dilation with a center an a given expansion/contraction factor         creates a dilation with a center an a given expansion/contraction factor
109         """         """
110         if not factor>0:         if not abs(factor)>0:
111            raise ValueError("factor must be positive.")            raise ValueError("factor must be non-zero.")
112         self.__factor=factor         self.__factor=factor
113         self.__center=numarray.array(center,type=_TYPE)         self.__center=numarray.array(center,type=_TYPE)
114      def __call__(self,x=numarray.zeros((3,))):      def __call__(self,x=numarray.zeros((3,))):

Legend:
Removed from v.907  
changed lines
  Added in v.915

  ViewVC Help
Powered by ViewVC 1.1.26