milkdrop demo improved & moved to Graphics => more surfaces
[scilab.git] / scilab / modules / graphics / demos / surface / milkdrop.sce
1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
3 // Copyright (C) 2017 - Samuel GOUGEON
4 //
5 // This file is released under the 3-clause BSD license. See COPYING-BSD.
6
7 function demo_milk_drop()
8     mode(-1);
9
10     my_handle             = scf(100001);
11     clf(my_handle,"reset");
12     demo_viewCode("milkdrop.sce");
13     my_plot_desc          = "milk drop";
14     my_handle.figure_name = my_plot_desc;
15     my_handle.color_map = jetcolormap(256);
16
17     x = -15:0.1:15;
18     y = x;
19     [X,Y] = ndgrid(x,y);
20     R = sqrt(X.^2+Y.^2);
21     // z= exp(-sq).*(exp(cos(sq).^20)+8*sin(sq).^20+2*sin(2*(sq)).^8);
22     Z = cos(R).*exp(-R/5);
23
24     plot3d(x, y, Z);
25     e = gce();
26     e.color_flag = 1;
27     e.thickness = 0;
28     a = gca();
29     a.rotation_angles = [85 30];
30     // DEMO END
31
32 endfunction
33
34 demo_milk_drop();
35 clear demo_milk_drop;