arrow3d with 3d function not displayed in plot3d

asked 2022-03-07 09:01:01 +0200

ortollj gravatar image

HI

SageMath 9.5 Ubuntu WSL2

arrow3d only is ok in plot3d.

arrow3d with 3d function not displayed in plot3d.

but arrow3d with 3d function is ok with implicit_plot3d.

var('x,y,z')
legend_label='f(x,y)'
def addAxis(plt) :
    # add axis for real part
    plt += arrow3d((0, 0, 0), (xBound, 0, 0), color='blue')
    plt += text3d("X", (xBound, 0, 0), color='blue')
    plt += arrow3d((0, 0, 0), (0, yBound, 0), color='green')
    plt += text3d("Y", (0, yBound, 0), color='green')
    plt += arrow3d((0, 0, 0), (0, 0, zBound), color='red')
    plt += text3d("Z", (0,0, zBound), color='red')
    plt += text3d(legend_label, (xBound,yBound, 0), color='red', fontsize=20,fontweight='bold',fontstyle='italic')
    return plt
xBound=2 ; yBound=2 ; zBound=2
f(x,y)=162*x^3*y
plt=Graphics()
plt=addAxis(plt)
# 3 arrows only
show(plt,viewer='threejs',figsize=8)

plt=addAxis(plt)
plt += plot3d(f(x,y),(x,-xBound,xBound),(y,-yBound,yBound), frame=False, color='purple', opacity=0.6)
#zBound=3
#plt += plot3d(f(x,y),(x,-xBound,xBound),(y,-yBound,yBound),(z,-zBound,zBound), frame=False, color='purple', opacity=0.6)
plt=addAxis(plt)
# 3 arrows+function plot
show(plt,viewer='threejs', figsize=8)

plt=Graphics()
plt=addAxis(plt)
plt += implicit_plot3d(f(x,y)-z,(x,-xBound,xBound),(y,-yBound,yBound),(z,-zBound,zBound), frame=False, color='purple', opacity=0.6)

show(plt,viewer='threejs', figsize=8)
edit retag flag offensive close merge delete