0001"""
0002**sphere objects** for reference drawing in connection with complex plane
0003projection and inversion
0004"""
0005
0006__Classes__ = ['uSphere','kSphere']
0007
0008__all__ = __Classes__
0009
0010
0011import pygeo.base.abstracts._usphere as USphere
0012from pygeo.base.support.pygeoconstants import WHITE
0013from pygeo.base.analytics.pygeomath import sqrt
0014
0015
0016class uSphere(USphere._uSphere):
0017 """
0018the origin centered sphere of unit radius representing the Riemann sphere
0019
0020 inherits
0021
0022 `_uSphere`__
0023
0024__ class-base.abstracts._usphere._uSphere.html
0025
0026 """
0027
0028 def __init__(self,**kw):
0029 USphere._uSphere.__init__(self,**kw)
0030 self.init()
0031
0032
0033class kSphere(USphere._uSphere):
0034 """
0035a sphere of radius sqrt(2) centered at vector(0,0,1)
0036
0037 inherits
0038
0039 `_uSphere`__
0040
0041__ class-base.abstracts._usphere._uSphere.html
0042
0043 """
0044
0045 def __init__(self,**kw):
0046 self.color=kw.get("color",WHITE)
0047 USphere._uSphere.__init__(self,**kw)
0048 self._radiusSquared=2
0049 self._radius=sqrt(2)
0050 self._center=USphere._rPoint(0,0,1,append=False)
0051 self.init()
0052
0053 def rmatrix(self):
0054 mat=Element.rmatrix(self)
0055 mat[3:]=array([[0.,1.,0.,1.0]])
0056 return mat