return the transformation to the exact coordinates for the intersection point last found by intersect() and optimizing based on beam's matrix. In this case, the beam matrix is not used, since our x,y are sensible choices since in the future, they are likely to be principal axes of an ellipsoid Definition at line 1128 of file general_optics.py. 01128 : 01129 """return the transformation to the exact coordinates for the intersection point last found by intersect() and optimizing based on beam's matrix. 01130 In this case, the beam matrix is not used, since our x,y are sensible choices since in the future, they are likely to be principal axes of an ellipsoid""" 01131 zhat=self.intersection_zhat 01132 xhat=cross(self.matrix_to_global[:,1], zhat) #use our real yhat x our zhat to generate xhat 01133 xmag=math.sqrt(Numeric.dot(xhat, xhat)) 01134 if xmag < 0.707: #bad guess for basis... mirror normal is very close to our yhat, use our xhat instead (they can't BOTH be bad!) 01135 yhat=cross( zhat, self.matrix_to_global[:,0]) #use our zhat x our real xhat to generate yhat (swapped to keep handedness) 01136 ymag=math.sqrt(Numeric.dot(yhat, yhat)) 01137 yhat/=ymag 01138 xhat=cross(yhat, zhat) #xhat is automatically a unit vector 01139 else: 01140 xhat /= xmag 01141 yhat=cross(zhat, xhat) #yhat is automatically a unit vector 01142 01143 return Numeric.array((xhat,yhat,zhat)) 01144 def local_transform(self):
|