Definition at line 1344 of file general_optics.py. 01344 : 01345 "rotate this object by an angle that makes it look at from_obj, assuming it started out looking along the z axis" 01346 if isinstance(from_obj, general_optic): 01347 fc=from_obj.exit_center() 01348 fn=from_obj.name 01349 else: 01350 fc=Numeric.array(from_obj) #assume is is a tuple or array 01351 fn=Numeric.array_str(fc, precision=3, suppress_small=1) 01352 01353 dx1=self.center-fc 01354 x,y,z=tuple(dx1) 01355 rho=math.sqrt(x*x+y*y) 01356 theta=math.atan2(rho,z)/deg 01357 eta=math.atan2(y,x)/deg 01358 if abs(eta)>90: #prefer signed theta and unsigned eta 01359 eta=180-eta 01360 theta=-theta 01361 self.update_coordinates(self.center, self.center, euler(theta, eta, 0).mat) 01362 return self #make daisy-chaining easy 01363 def __getitem__(self, tag):
|