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): |