Пример #1
0
 def __mul__(self, other):
     if isinstance(other, RayTransferMatrix):
         return RayTransferMatrix(Matrix.__mul__(self, other))
     elif isinstance(other, GeometricRay):
         return GeometricRay(Matrix.__mul__(self, other))
     elif isinstance(other, BeamParameter):
         temp = self*Matrix(((other.q,), (1,)))
         q = (temp[0]/temp[1]).expand(complex=True)
         return BeamParameter(other.wavelen,
                              together(re(q)),
                              z_r=together(im(q)))
     else:
         return Matrix.__mul__(self, other)
Пример #2
0
 def __mul__(self, other):
     if isinstance(other, RayTransferMatrix):
         return RayTransferMatrix(Matrix.__mul__(self, other))
     elif isinstance(other, GeometricRay):
         return GeometricRay(Matrix.__mul__(self, other))
     elif isinstance(other, BeamParameter):
         temp = self * Matrix(((other.q, ), (1, )))
         q = (temp[0] / temp[1]).expand(complex=True)
         return BeamParameter(other.wavelen,
                              together(re(q)),
                              z_r=together(im(q)))
     else:
         return Matrix.__mul__(self, other)