milkdrop demo improved & moved to Graphics => more surfaces 79/19479/2
Samuel GOUGEON [Wed, 11 Oct 2017 12:01:53 +0000 (14:01 +0200)]
Change-Id: I73af6da48ebd9e941ac8981957007b8ce922a770

scilab/modules/graphics/demos/basic_functions/basic_functions.dem.gateway.sce
scilab/modules/graphics/demos/surface/milkdrop.sce [moved from scilab/modules/graphics/demos/basic_functions/basic_functions_9.dem.sce with 58% similarity]
scilab/modules/graphics/demos/surface/surfaces.dem.gateway.sce

index e833eac..d47077e 100644 (file)
@@ -14,7 +14,6 @@ subdemolist=[
 "Colored matrix"                                   , "basic_functions_6.dem.sce" ; ...
 "Colored histogram"                                , "basic_functions_7.dem.sce" ; ...
 "Pie Chart"                                        , "basic_functions_8.dem.sce" ; ...
-"Milk Drop"                                        , "basic_functions_9.dem.sce" ; ...
 "Xarrows"                                          , "basic_functions_xarrows.dem.sce"; ];
 
 subdemolist(:, 2) = demopath + subdemolist(:, 2);
@@ -1,34 +1,35 @@
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 // Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+// Copyright (C) 2017 - Samuel GOUGEON
 //
 // This file is released under the 3-clause BSD license. See COPYING-BSD.
 
-function demo_basic_functions9()
-    function [z]=__milk_drop(x,y)
-        sq=x.^2+y.^2;
-        z= exp( exp(-sq).*(exp(cos(sq).^20)+8*sin(sq).^20+2*sin(2*(sq)).^8) );
-    endfunction
+function demo_milk_drop()
     mode(-1);
 
     my_handle             = scf(100001);
     clf(my_handle,"reset");
-    demo_viewCode("basic_functions_9.dem.sce");
+    demo_viewCode("milkdrop.sce");
     my_plot_desc          = "milk drop";
     my_handle.figure_name = my_plot_desc;
     my_handle.color_map = jetcolormap(256);
 
-    x = -2:0.1:2;
+    x = -15:0.1:15;
     y = x;
     [X,Y] = ndgrid(x,y);
-    z = __milk_drop(X,Y);
-    plot3d(x, y, z);
+    R = sqrt(X.^2+Y.^2);
+    // z= exp(-sq).*(exp(cos(sq).^20)+8*sin(sq).^20+2*sin(2*(sq)).^8);
+    Z = cos(R).*exp(-R/5);
+
+    plot3d(x, y, Z);
     e = gce();
     e.color_flag = 1;
+    e.thickness = 0;
     a = gca();
-    a.rotation_angles = [25, 30];
+    a.rotation_angles = [85 30];
     // DEMO END
 
 endfunction
 
-demo_basic_functions9();
-clear demo_basic_functions9;
+demo_milk_drop();
+clear demo_milk_drop;
index 7cec882..ba6d12b 100644 (file)
@@ -5,18 +5,21 @@
 
 demopath = get_absolute_file_path("surfaces.dem.gateway.sce");
 
-subdemolist=["Surface with holes 1"    , "hole3d.sce"   ; ..
-"Surface with holes 2"    , "hole3d1.sce"  ; ..
-"Sphere"                  , "sphere.sce"   ; ..
-"Shell"                   , "shell.sce"    ; ..
-"Spiral"                  , "spiral.sce"   ; ..
-"Rings"                   , "rings.sce"    ; ..
-"Torus"                   , "torus.sce"    ; ..
-"Torus 1"                 , "torus1.sce"   ; ..
-"Moebius"                 , "moebius.sce"  ; ..
-"Tube"                    , "tube.sce"     ; ..
-"Black Hole"              , "bh.sce"       ; ..
-"Riemann surface (n=2)"   , "cplxroot.sce" ];
+subdemolist = [
+"Milk drop"               , "milkdrop.sce"
+"Surface with holes 1"    , "hole3d.sce"
+"Surface with holes 2"    , "hole3d1.sce"
+"Sphere"                  , "sphere.sce"
+"Shell"                   , "shell.sce"
+"Spiral"                  , "spiral.sce"
+"Rings"                   , "rings.sce"
+"Torus"                   , "torus.sce"
+"Torus 1"                 , "torus1.sce"
+"Moebius"                 , "moebius.sce"
+"Tube"                    , "tube.sce"
+"Black Hole"              , "bh.sce"
+"Riemann surface (n=2)"   , "cplxroot.sce"
+];
 
 subdemolist(:,2) = demopath + subdemolist(:,2);
-clear demopath;
\ No newline at end of file
+clear demopath;