def _(season=['winter','spring','summer','autumn']):
var('x,y,z'); x0,y0,z0,s=.4,.15,.15,.1
f=4*x^2+4*y^2-(z-1.3)^2; g=cos(49*x+16*y)*sin(50*z)
hat=implicit_plot3d(f,(x,-1,1),(y,-1,1),(z,.3,1.3),\
color=(g.function(x,y,z),colormaps[season]))
head=sphere(size=5*s,color='pink')
eyes=sum([sphere((x0,i*y0,z0),size=s,color=(1,1,1))+\
sphere((x0+.06,i*y0,z0+.02),size=s/2,
color=(0,0,0)) for i in [-1,1]])
nose=sphere((x0+.1,0,-z0+.05),size=s,color='pink')
mouth=sphere((x0-.1,0,-2*z0),size=s,color='red')
(hat+head+eyes+nose+mouth).show(frame=False)
No comments:
Post a Comment