1 | initial version |
Here are two ways to code this. To begin, you should try:
var('x y z')
p=implicit_plot3d((x-2)*(x^2-1),[x,-3,3],[y,-3,3],[z,-3,3],color='red',opacity=0.7)
p+=implicit_plot3d(y*(x^2-y),[x,-3,3],[y,-3,3],[z,-3,3],color='green',opacity=0.7)
p+=implicit_plot3d((z+1)*(x^2-1),[x,-3,3],[y,-3,3],[z,-3,3],color='blue',opacity=0.7)
show(p)
Another approach using the add
command and a list comprehension is:
var('x y z')
V=[(x-2)*(x^2-1) , y*(x^2-y),(z+1)*(x^2-1)]
c=['red','green','blue']
p=add([implicit_plot3d(V[i],[x,-3,3],[y,-3,3],[z,-3,3],color=c[i],opacity=0.7) for i in [0..2]])
show(p)