Goursat SurfaceΒΆ

../../_images/goursat1.png
import numpy as np
import matplotlib.pyplot as plt
import s3dlib.surface as s3d

#.. Goursat Surface

def goursat_tangle(xyz):
    x,y,z = xyz
    a,b,c = 0.0,-5.0,11.8
    return x**4+y**4+z**4+a*(x**2+y**2+z**2)**2+b*(x**2+y**2+z**2)+c

rez,dmn = 6, 2.5
surface = s3d.Surface3DCollection.implsurf( goursat_tangle,rez,dmn )
surface.map_cmap_from_op(lambda c: s3d.SphericalSurface.coor_convert(c)[0])

fig = plt.figure(figsize=plt.figaspect(1))
ax = plt.axes(projection='3d', aspect='equal')
ax.set_title(surface.name,pad=-1)
s3d.auto_scale(ax,surface)
ax.set(xlabel='X',ylabel='Y',zlabel='Z')
ax.add_collection3d(surface.shade().hilite(focus=2))

fig.tight_layout()
plt.show()