0001"""
0002**array of lines** on the complex plane
0003"""
0004
0005__Def__ = ['zLineArray']
0006
0007__Classes__ = ['zLinePencil']
0008
0009__all__ = __Classes__ + __Def__
0010
0011__doc_hints__={'m_type':'factory'}
0012
0013import pygeo.base.abstracts._complex as Complex
0014
0015from pygeo.base.analytics.pygeomath import PI, math_E
0016
0017class zLinePencil(Complex._zLineArray):
0018 """
0019*array of lines* on the complex plane and through the given **complex point**
0020
0021 inherits
0022
0023 `_zLineArray`__
0024
0025__ class-base.abstracts._complex._zLineArray.html
0026
0027 """
0028 __doc_hints__= {'factory':'zLineArray',
0029 'args':['zpoint']}
0030
0031 def __init__(self,zpoint,**kws):
0032 Complex._zLineArray.__init__(self,*[zpoint],**kws)
0033 self.zpoint=zpoint
0034 self.adelta=2*PI/self.density
0035 self.init()
0036
0037 def findSelf(self):
0038 zpoint=self.zpoint
0039 for i, zline in enumerate(self.zlines):
0040 angle=i*self.adelta
0041 zline.p1.set(zpoint)
0042 zline.p2.set(complex(0,1)*(math_E**complex(0,angle))+zpoint)
0043 zline.set_hermitian_from_points()
0044 return True
0045
0046def zLineArray(*args,**kws):
0047 """
0048'class factory' function returns instance of object derived from the
0049_zLineArray abstract class representing an array of lines (i.e. circles of infinite radius)
0050on the complex plane
0051 """
0052 from pygeo.base.abstracts._element import method_get
0053 from pygeo.base.support.pygeoexceptions import Argument_Type_Error
0054
0055 __sigs__=[[Complex._zPoint]]
0056
0057 t,i = method_get(__sigs__,args)
0058
0059 if t is None:
0060 raise Argument_Type_Error(__sigs__,args)
0061 else:
0062 if i==0:
0063 return zLinePencil(t[0],**kws)
0064 else:
0065 raise Argument_Type_Error(__sigs__,args)