Ask Your Question
4

Calimero effect in plot3d

asked 2020-11-02 08:32:27 +0100

ortollj gravatar image

updated 2020-11-02 19:06:20 +0100

FrédéricC gravatar image

just out of curiosity, what is the reason for this Calimero effect ? image description?

from sage.plot.plot3d.plot3d import axes
var('x,y,z,r,alpha,beta,gamma',domain='real')
#rNum=1;alphaNum=0;betaNum=pi/4;gammaNum=pi/4
#rNum=1;alphaNum=pi/7;betaNum=pi/7;gammaNum=pi/7
rNum=1.0;alphaNum=pi/12;betaNum=pi/8;gammaNum=pi/6

numL=[r==rNum,alpha==alphaNum,beta==betaNum,gamma==gammaNum]

eqS=r^2==x^2+y^2+z^2

X=solve(eqS,x)[1].rhs()
Y=solve(eqS,y)[1].rhs()
Z=solve(eqS,z)[1].rhs()
Znum=Z.subs(numL)

S = matrix(SR,[X,Y,Z]).transpose()
Snum=S.subs(numL)
#show('S : ',S,'\t S num : ',Snum)
Plt=plot3d(Znum, (x,0,rNum), (y,0,rNum) , frame=False, color="blue",opacity=0.1)
# plot the three axis
Plt+=arrow((0,0,0), (rNum,0,0), color='black')
Plt+=text3d("X",vector([rNum,0,0])*1.1, color='black')

Plt+=arrow((0,0,0), (0,rNum,0), color='brown')
Plt+=text3d("Y",vector([0,rNum,0])*1.1, color='brown')

Plt+=arrow((0,0,0), (0,0,rNum), color='red')
Plt+=text3d("Z",vector([0,0,rNum])*1.1, color='red')
margin=0.1

show(Plt,xmax=rNum+margin,ymax=rNum+margin,zmax=rNum+margin)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2020-11-02 09:00:40 +0100

FrédéricC gravatar image

Well, this is probably because the function in plot3d is not defined on the full square. The method "add_condition" of 3D plots does a better job in cutting surfaces.

edit flag offensive delete link more

Comments

yes,adding a few options makes this effect disappear :

Plt=plot3d(Znum, (x,0,rNum), (y,0,rNum) , frame=True, color="blue",opacity=0.5, plot_points=200,adaptive=True) show(Plt,xmax=rNum+margin,ymax=rNum+margin,zmin=-margin,zmax=rNum+margin)

ortollj gravatar imageortollj ( 2020-11-02 09:50:45 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-11-02 08:32:27 +0100

Seen: 925 times

Last updated: Nov 02 '20