def place_between (   self,
  from_obj,
  to_obj,
  distance 
)

Definition at line 704 of file general_optics.py.

00704                                                            :
00705                 "place_between(from, to, distance, set_info) puts the optic between object or coordinate 'from' and 'to' and rotates it to the specified axis."
00706                 if isinstance(from_obj, general_optic):
00707                         fc=from_obj.exit_center()
00708                         fn=from_obj.name
00709                 else:
00710                         fc=Numeric.array(from_obj) #assume is is a tuple or array
00711                         fn=Numeric.array_str(fc, precision=3, suppress_small=1)
00712                 if isinstance(to_obj, general_optic):
00713                         tc=to_obj.entrance_center()
00714                         tn=to_obj.name
00715                 else:
00716                         tc=Numeric.array(to_obj) #assume is is a tuple or array
00717                         tn=Numeric.array_str(tc, precision=3, suppress_small=1)
00718                 
00719                 dx1=tc-fc
00720                 dx1hat=dx1/vec_mag(dx1)
00721                 if distance > 0.0:
00722                         self.center=fc+distance*dx1hat
00723                 else:
00724                         self.center=tc+distance*dx1hat
00725                         
00726                 x,y,z=tuple(dx1.flat)
00727                 rho=math.sqrt(x*x+y*y)
00728                 theta=math.atan2(rho,z)/deg
00729                 eta=math.atan2(y,x)/deg
00730                 self.reset_angle((theta, eta, 0))               
00731                 return self #make daisy-chaining easy!
00732 
        def set_direction(self, from_obj, to_obj):


Generated on Wed Nov 21 10:18:32 2007 for analysis by  doxygen 1.5.4