trunc of a 3D surface not very clean

asked 2021-11-26 18:03:04 +0100

ErWinz gravatar image

hi my condition |x|>0.2 makes the "truncature" of the surface not very beautiful can i "cut" more properly ? image description

f(x,y)=y/x+x^2*y
show(html("<h4>fonction H : Derviches…</h4>"))    
lacouleur="olivedrab"
leratio=(1,1,1/4)

# calculs généraux
from sage.manifolds.operators import *
E.<x,y> = EuclideanSpace()
F = E.scalar_field(f)
H=f(x,y).hessian()
show(html("<h5>paramètres généraux</h5>"))
T=table([["f",f],["grad f=",grad(F)[:]],["H=",H]],frame=True,align='center')
show(T)

# calcul des points critiques
Cr= solve([grad(f)[0]==0,grad(f)[1]==0],[x,y],solution_dict=True)
liste=[]
for critique in Cr:
    x_et_y_reels=(x(critique).imag()==0 and y(critique).imag()==0)
    x_et_y_avec_parametre=(len(x(critique).variables())>0 or len(y(critique).variables())>0)
    if(x_et_y_reels or x_et_y_avec_parametre): 
        liste.append(["(","x","=",x(critique),";","y","=",y(critique),")",H(critique)])        
show(html("<h5>points critiques</h5>"))
if (len(liste)!=0):
    show(table(liste))
else :
    show("pas de points critiques")

# graphique
h(x,y,z)=f(x,y)-z
implicit_plot3d(h, (x, -2.25,2), (y, -2.25, 2), (z, -10, 10),color=lacouleur,aspect_ratio=leratio,adaptive=True,mesh=True,region=lambda x,y,z: x<=-0.2 or x>=0.2)
edit retag flag offensive close merge delete

Comments

1

Yeah. I would probably remove the mesh, and add plot_points=190

jakupl gravatar imagejakupl ( 2021-11-28 22:13:08 +0100 )edit