import numpy as np
from mayavi import mlab

def f1(x,y):
	return 4*np.sin(x)*np.cos(y)
	
def f2(x,y):
	return np.sin(x**2+y**2)

mlab.figure(figure=None, bgcolor=(0.5,0.5,0.5), fgcolor=None, engine=None, size=(800, 600))

#prva funkcija
#primijeni scalar_cut_plane
#stavi mrezu na plohu i napravi mrezastu plohu
x,y = np.mgrid[0:4*np.pi:100j, 0:4*np.pi:100j]
mlab.surf(x,y, f1, colormap='summer',representation='surface')

#druga funkcija surf plot
x2, y2 = np.mgrid[-np.pi:np.pi:200j, -np.pi:np.pi:200j]
mlab.surf(x2,y2,f2(x2,y2), colormap='gist_earth')

#druga funkcija mesh plot prijelaz na polarne koordinate
fi,r = np.mgrid[0:2*np.pi:100j, 0:4:100j]
x3=r*np.cos(fi)
y3=r*np.sin(fi)
mlab.mesh(x3, y3, f2(x3,y3), colormap='gist_earth')

mlab.show()