summaryrefslogtreecommitdiff
path: root/modules/graphics/demos/cmplxfunc
diff options
context:
space:
mode:
Diffstat (limited to 'modules/graphics/demos/cmplxfunc')
-rwxr-xr-xmodules/graphics/demos/cmplxfunc/MacCmplx.sci151
-rwxr-xr-xmodules/graphics/demos/cmplxfunc/cmplxfunc.dem.gateway.sce24
-rwxr-xr-xmodules/graphics/demos/cmplxfunc/demo_acos.dem.sce26
-rwxr-xr-xmodules/graphics/demos/cmplxfunc/demo_acosh.dem.sce27
-rwxr-xr-xmodules/graphics/demos/cmplxfunc/demo_asin.dem.sce25
-rwxr-xr-xmodules/graphics/demos/cmplxfunc/demo_asinh.dem.sce27
-rwxr-xr-xmodules/graphics/demos/cmplxfunc/demo_atan.dem.sce26
-rwxr-xr-xmodules/graphics/demos/cmplxfunc/demo_atanh.dem.sce27
-rwxr-xr-xmodules/graphics/demos/cmplxfunc/demo_cos.dem.sce26
-rwxr-xr-xmodules/graphics/demos/cmplxfunc/demo_cosh.dem.sce26
-rwxr-xr-xmodules/graphics/demos/cmplxfunc/demo_custom.dem.sce821
-rwxr-xr-xmodules/graphics/demos/cmplxfunc/demo_exp.dem.sce27
-rwxr-xr-xmodules/graphics/demos/cmplxfunc/demo_log.dem.sce28
-rwxr-xr-xmodules/graphics/demos/cmplxfunc/demo_sin.dem.sce28
-rwxr-xr-xmodules/graphics/demos/cmplxfunc/demo_sinh.dem.sce28
-rwxr-xr-xmodules/graphics/demos/cmplxfunc/demo_tan.dem.sce26
-rwxr-xr-xmodules/graphics/demos/cmplxfunc/demo_tanh.dem.sce28
-rwxr-xr-xmodules/graphics/demos/cmplxfunc/warning.pngbin0 -> 1677 bytes
18 files changed, 1371 insertions, 0 deletions
diff --git a/modules/graphics/demos/cmplxfunc/MacCmplx.sci b/modules/graphics/demos/cmplxfunc/MacCmplx.sci
new file mode 100755
index 000000000..bd6d33fb0
--- /dev/null
+++ b/modules/graphics/demos/cmplxfunc/MacCmplx.sci
@@ -0,0 +1,151 @@
+//
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2001 - Bruno PINCON
+// Copyright (C) 2005 - INRIA - Pierre MARECHAL <pierre.marechal@inria.fr>
+//
+// This file is distributed under the same license as the Scilab package.
+//
+
+function [xr,yr,zr,xi,yi,zi] = CmplxFacets(R,e,TypeDomain,TypeCut,n,StrFunc)
+
+ // A function to compute the facets for drawing a complex function
+ // on a square or a disk with branch(es) cut(s) on Ox or Oy
+ //
+ // TypeDomain : "Square" or "Disk"
+ // TypeCut : "Ox" or "Oy"
+ // R : length of half a side of the square or radius of the disk
+ // e : thin layer to avoid the branch(es) cut(s)
+ // n : a scalar (for Square) or a 2-vector = [ntheta, nr]
+ // (for Disk) for discretization
+ // StrFunc : the string which names the complex function (this is
+ // because primitive don't pass as function argument)
+ //
+ // Bruno (10/10/2001): macros for the complex function dem
+
+ if TypeDomain == "Square" then
+ if TypeCut == "Ox" then
+ x1 = linspace(-R, R, n);
+ y1 = linspace( e, R, floor(n/2));
+ else // for TypeCut = "Oy" ...
+ x1 = linspace( e, R, floor(n/2));
+ y1 = linspace(-R, R, n);
+ end
+ X1 = ones(y1')*x1 ; Y1 = y1'*ones(x1);
+ else // for TypeDomain = "Disk"
+ r = linspace(0,R, n(2));
+ if TypeCut == "Ox" then
+ theta = linspace(0,%pi,n(1))';
+ X1 = cos(theta)*r;
+ Y1 = e + sin(theta)*r;
+ else // for TypeCut = "Oy"
+ theta = linspace(-%pi/2,%pi/2,n(1))';
+ X1 = e + cos(theta)*r;
+ Y1 = sin(theta)*r;
+ end
+ end
+ X2 = -X1 ; Y2 = -Y1;
+ Z1 = evstr(StrFunc+"(X1 + %i*Y1)");
+ Z2 = evstr(StrFunc+"(X2 + %i*Y2)");
+ [xr1,yr1,zr1] = nf3d(X1,Y1,real(Z1));
+ [xr2,yr2,zr2] = nf3d(X2,Y2,real(Z2));
+ xr = [xr1 xr2]; yr = [yr1 yr2]; zr = [zr1 zr2];
+ [xi1,yi1,zi1] = nf3d(X1,Y1,imag(Z1));
+ [xi2,yi2,zi2] = nf3d(X2,Y2,imag(Z2));
+ xi = [xi1 xi2]; yi = [yi1 yi2]; zi = [zi1 zi2];
+endfunction
+
+
+function []=PlotCmplxFunc(R,e,TypeDomain,TypeCut,n,StrFunc,theta,alpha,DomReal)
+
+ // A function to draw on a square or a disk a complex function
+ // with branch(es) cut(s) on Ox or Oy
+ //
+ // TypeDomain : "Square" or "Disk"
+ // TypeCut : "Ox" or "Oy"
+ // R : length of half a side of the square or radius of the disk
+ // e : thin layer to avoid the branch(es) cut(s)
+ // n : a scalar (for Square) or a 2-vector = [ntheta, nr]
+ // (for Disk) for discretization
+ // StrFunc : the string which names the complex function (this is
+ // because primitive don't pass as function argument)
+ // theta,alpha : usual parameters for plot3d
+ // DomReal : interval for which the real restriction is drawn
+
+ // Bruno (10/10/2001): macros for the complex function dem
+
+ // Adapted for new graphic by Pierre MARECHAL ( 16/12/2005 )
+
+ // computes the facets
+
+ [xr,yr,zr,xi,yi,zi] = CmplxFacets(R,e,TypeDomain,TypeCut,n,StrFunc)
+
+ // draw
+ // ============================================
+
+ current_figure_hdl = scf(100001);
+ clf(current_figure_hdl,"reset");
+
+ drawlater();
+
+ // Title
+ // ============================================
+
+ my_title_axes = newaxes();
+
+ // make axes transparent
+ my_title_axes.filled = "off";
+
+ Rs = string(R);
+
+ if TypeDomain == "Square" then
+ end_title = " Function on [-"+Rs+","+Rs+"]x[-"+Rs+","+Rs+"]"
+ else
+ end_title = " Function on D(0,R="+Rs+")"
+ end
+
+ if StrFunc == "f" then
+ the_title = "Your Custom (named f) Complex" + end_title;
+ else
+ the_title = "The Complex " + StrFunc + end_title;
+ end
+
+ xtitle(the_title);
+
+ my_title_axes.title.text = the_title;
+ my_title_axes.title.font_size = 3;
+ my_title_axes.title.font_style = 2;
+ my_title_axes.margins = [ 0.08 0.08 0.08 0.08 ]
+
+ // plot Im(z)
+ // ============================================
+
+ subplot(1,2,1);
+ plot3d(xi,yi,zi,theta,alpha,"Re(z)@Im(z)@",[2 6 4]);
+ xtitle("Im("+StrFunc+"(z))");
+
+ // plot Re(z) + the real restriction
+ // ============================================
+
+ subplot(1,2,2);
+ plot3d(xr,yr,zr,theta,alpha,"Re(z)@Im(z)@",[ 2 6 4]);
+ xtitle("Re("+StrFunc+"(z))");
+
+ // real function in yellow
+ // ============================================
+
+ if DomReal(2) > DomReal(1) then
+ //xstring(0.1,-0.15," In yellow : the real "+StrFunc+" function")
+ xx = linspace(DomReal(1),DomReal(2),40)';
+ yy = zeros(xx);
+ zz = evstr(StrFunc+"(xx)");
+ param3d1(xx,yy,list(zz,32),theta,alpha,flag=[0,0]);
+ yellow_line = get("hdl");
+ yellow_line.thickness = 3;
+ captions(yellow_line, "the real "+StrFunc+" function", "lower_caption");
+ end
+
+
+
+ drawnow();
+
+endfunction
diff --git a/modules/graphics/demos/cmplxfunc/cmplxfunc.dem.gateway.sce b/modules/graphics/demos/cmplxfunc/cmplxfunc.dem.gateway.sce
new file mode 100755
index 000000000..c65a15f68
--- /dev/null
+++ b/modules/graphics/demos/cmplxfunc/cmplxfunc.dem.gateway.sce
@@ -0,0 +1,24 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2005-2008 - INRIA - Pierre MARECHAL <pierre.marechal@inria.fr>
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+demopath = get_absolute_file_path("cmplxfunc.dem.gateway.sce");
+
+subdemolist = ["log" ,"demo_log.dem.sce" ; ..
+"exp" ,"demo_exp.dem.sce" ; ..
+"tan" ,"demo_tan.dem.sce" ; ..
+"atan" ,"demo_atan.dem.sce" ; ..
+"sin" ,"demo_sin.dem.sce" ; ..
+"asin" ,"demo_asin.dem.sce" ; ..
+"cos" ,"demo_cos.dem.sce" ; ..
+"sinh" ,"demo_sinh.dem.sce" ; ..
+"asinh" ,"demo_asinh.dem.sce" ; ..
+"cosh" ,"demo_cosh.dem.sce" ; ..
+"acosh" ,"demo_acosh.dem.sce" ; ..
+"tanh" ,"demo_tanh.dem.sce" ; ..
+"atanh" ,"demo_atanh.dem.sce" ; ..
+"custom" ,"demo_custom.dem.sce" ];
+
+subdemolist(:,2) = demopath + subdemolist(:,2);
+clear demopath;
diff --git a/modules/graphics/demos/cmplxfunc/demo_acos.dem.sce b/modules/graphics/demos/cmplxfunc/demo_acos.dem.sce
new file mode 100755
index 000000000..c61549e63
--- /dev/null
+++ b/modules/graphics/demos/cmplxfunc/demo_acos.dem.sce
@@ -0,0 +1,26 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+// =============================================================================
+// acos
+// =============================================================================
+
+function demo_acos()
+
+ exec("SCI/modules/graphics/demos/cmplxfunc/MacCmplx.sci", -1);
+ theta = -110;
+ alpha = 75;
+
+ my_handle = scf(100001);
+ clf(my_handle,"reset");
+
+ PlotCmplxFunc(2,%eps,"Square","Ox",41,"acos",theta,alpha,[-1,1]);
+ demo_viewCode("demo_acos.dem.sce");
+
+endfunction
+
+demo_acos()
+
+clear demo_acos;
diff --git a/modules/graphics/demos/cmplxfunc/demo_acosh.dem.sce b/modules/graphics/demos/cmplxfunc/demo_acosh.dem.sce
new file mode 100755
index 000000000..6c64f4133
--- /dev/null
+++ b/modules/graphics/demos/cmplxfunc/demo_acosh.dem.sce
@@ -0,0 +1,27 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+// =============================================================================
+// acosh
+// =============================================================================
+
+function demo_acosh()
+
+ exec("SCI/modules/graphics/demos/cmplxfunc/MacCmplx.sci", -1);
+ R = 2;
+ e = %eps;
+ theta = -110;
+ alpha = 75;
+
+ my_handle = scf(100001);
+ clf(my_handle,"reset");
+
+ PlotCmplxFunc(R,e,"Square","Ox",41,"acosh",theta,alpha,[1,R]);
+ demo_viewCode("demo_acosh.dem.sce");
+
+endfunction
+
+demo_acosh()
+clear demo_acosh;
diff --git a/modules/graphics/demos/cmplxfunc/demo_asin.dem.sce b/modules/graphics/demos/cmplxfunc/demo_asin.dem.sce
new file mode 100755
index 000000000..b24dd69f6
--- /dev/null
+++ b/modules/graphics/demos/cmplxfunc/demo_asin.dem.sce
@@ -0,0 +1,25 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+// =============================================================================
+// asin
+// =============================================================================
+
+function demo_asin()
+
+ exec("SCI/modules/graphics/demos/cmplxfunc/MacCmplx.sci", -1);
+ theta = -110;
+ alpha = 75;
+
+ my_handle = scf(100001);
+ clf(my_handle,"reset");
+
+ PlotCmplxFunc(2,%eps,"Square","Ox",41,"asin",theta,alpha,[-1,1]);
+ demo_viewCode("demo_asin.dem.sce");
+
+endfunction
+
+demo_asin()
+clear demo_asin;
diff --git a/modules/graphics/demos/cmplxfunc/demo_asinh.dem.sce b/modules/graphics/demos/cmplxfunc/demo_asinh.dem.sce
new file mode 100755
index 000000000..89517aa09
--- /dev/null
+++ b/modules/graphics/demos/cmplxfunc/demo_asinh.dem.sce
@@ -0,0 +1,27 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+// =============================================================================
+// asinh
+// =============================================================================
+
+function demo_asinh()
+
+ exec("SCI/modules/graphics/demos/cmplxfunc/MacCmplx.sci", -1);
+ R = 2;
+ e = %eps;
+ theta = -110;
+ alpha = 75;
+
+ my_handle = scf(100001);
+ clf(my_handle,"reset");
+
+ PlotCmplxFunc(R,e,"Square","Oy",41,"asinh",theta,alpha,[-R,R]);
+ demo_viewCode("demo_asinh.dem.sce");
+
+endfunction
+
+demo_asinh()
+clear demo_asinh;
diff --git a/modules/graphics/demos/cmplxfunc/demo_atan.dem.sce b/modules/graphics/demos/cmplxfunc/demo_atan.dem.sce
new file mode 100755
index 000000000..9e54dead2
--- /dev/null
+++ b/modules/graphics/demos/cmplxfunc/demo_atan.dem.sce
@@ -0,0 +1,26 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+// =============================================================================
+// atan
+// =============================================================================
+
+function demo_atan()
+
+ exec("SCI/modules/graphics/demos/cmplxfunc/MacCmplx.sci", -1);
+ R = 2;
+ theta = -110;
+ alpha = 75;
+
+ my_handle = scf(100001);
+ clf(my_handle,"reset");
+
+ PlotCmplxFunc(R,0.001,"Square","Oy",41,"atan",theta,alpha,[-R,R]);
+ demo_viewCode("demo_atan.dem.sce");
+
+endfunction
+
+demo_atan()
+clear demo_atan;
diff --git a/modules/graphics/demos/cmplxfunc/demo_atanh.dem.sce b/modules/graphics/demos/cmplxfunc/demo_atanh.dem.sce
new file mode 100755
index 000000000..65cd55dfd
--- /dev/null
+++ b/modules/graphics/demos/cmplxfunc/demo_atanh.dem.sce
@@ -0,0 +1,27 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+// =============================================================================
+// atanh
+// =============================================================================
+
+function demo_atanh()
+
+ exec("SCI/modules/graphics/demos/cmplxfunc/MacCmplx.sci", -1);
+ R = 2;
+ e = 0.001;
+ theta = -110;
+ alpha = 75;
+
+ my_handle = scf(100001);
+ clf(my_handle,"reset");
+
+ PlotCmplxFunc(R,e,"Square","Ox",41,"atanh",theta,alpha,[-0.99,0.99]);
+ demo_viewCode("demo_atanh.dem.sce");
+
+endfunction
+
+demo_atanh()
+clear demo_atanh;
diff --git a/modules/graphics/demos/cmplxfunc/demo_cos.dem.sce b/modules/graphics/demos/cmplxfunc/demo_cos.dem.sce
new file mode 100755
index 000000000..92dda89b7
--- /dev/null
+++ b/modules/graphics/demos/cmplxfunc/demo_cos.dem.sce
@@ -0,0 +1,26 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+// =============================================================================
+// cos
+// =============================================================================
+
+function demo_cos()
+
+ exec("SCI/modules/graphics/demos/cmplxfunc/MacCmplx.sci", -1);
+ R = %pi;
+ theta = 18;
+ alpha = 43;
+
+ my_handle = scf(100001);
+ clf(my_handle,"reset");
+
+ PlotCmplxFunc(R,0,"Disk","Ox",[40 20],"cos",theta,alpha,[-R,R]);
+ demo_viewCode("demo_cos.dem.sce");
+
+endfunction
+
+demo_cos()
+clear demo_cos;
diff --git a/modules/graphics/demos/cmplxfunc/demo_cosh.dem.sce b/modules/graphics/demos/cmplxfunc/demo_cosh.dem.sce
new file mode 100755
index 000000000..e2fdfb8a7
--- /dev/null
+++ b/modules/graphics/demos/cmplxfunc/demo_cosh.dem.sce
@@ -0,0 +1,26 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+// =============================================================================
+// cosh
+// =============================================================================
+
+function demo_cosh()
+
+ exec("SCI/modules/graphics/demos/cmplxfunc/MacCmplx.sci", -1);
+ R = %pi;
+ e = 0;
+ theta = -130;
+ alpha = 56;
+
+ my_handle = scf(100001);
+ clf(my_handle,"reset");
+
+ PlotCmplxFunc(R,e,"Disk","Ox",[40 20],"cosh",theta,alpha,[-R,R]);
+ demo_viewCode("demo_cosh.dem.sce");
+endfunction
+
+demo_cosh()
+clear demo_cosh;
diff --git a/modules/graphics/demos/cmplxfunc/demo_custom.dem.sce b/modules/graphics/demos/cmplxfunc/demo_custom.dem.sce
new file mode 100755
index 000000000..f57f29d00
--- /dev/null
+++ b/modules/graphics/demos/cmplxfunc/demo_custom.dem.sce
@@ -0,0 +1,821 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - DIGITEO
+// Copyright (C) 2014 - Scilab Enterprises - Paul Bignier
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+funcprot(0);
+
+function demo_custom()
+
+ // Parameters
+ // =========================================================================
+
+ frame_w = 300; // Frame width
+ frame_h = 765; // Frame height
+
+ plot_w = 500; // Plot width
+ plot_h = frame_h; // Plot height
+
+ margin_x = 15; // Horizontal margin between each elements
+ margin_y = 15; // Vertical margin between each elements
+
+ defaultfont = "arial"; // Default Font
+
+ // Figure creation
+ // =========================================================================
+
+ axes_w = 3*margin_x + frame_w + plot_w; // axes width
+ axes_h = 2*margin_y + frame_h; // axes height (100 => toolbar height)
+
+ fig_handle = figure( ...
+ "infobar_visible", "off", ...
+ "menubar", "none", ...
+ "toolbar", "none", ...
+ "default_axes", "on", ...
+ "layout", "gridbag", ...
+ "visible", "off", ...
+ "background", -2, ...
+ "figure_position", [0 0], ...
+ "axes_size", [axes_w axes_h], ...
+ "figure_name", _("Customize your complex function"));
+
+ // The plot will be in the right 2/3 of the figure
+ a = gca();
+ a.axes_bounds = [1/3 1 2/3 1];
+ a.tight_limits = "on";
+
+ c = createConstraints("gridbag", [2 1 2 1], [1 1], "vertical", "right");
+ // Create an empty panel on the right to occupy the 3/4 of the screen (figure plot)
+ empty_frame = uicontrol(fig_handle, "style", "frame","constraints", c);
+
+ c = createConstraints("gridbag", [1 1 1 5], [0.25 1], "both", "left", [0 0], [150 0]);
+ u = uicontrol(fig_handle, ...
+ "style", "frame", ...
+ "backgroundcolor", [1 1 1], ...
+ "layout", "border", ...
+ "constraints", c);
+
+ // Add top and bottom empty panels to pad the upcoming control panel
+ c = createConstraints("border", "top", [0 20]);
+ top = uicontrol(u, "style", "frame", "backgroundcolor", [1 1 1], "constraints", c);
+ c = createConstraints("border", "bottom", [0 20]);
+ bottom = uicontrol(u, "style", "frame", "backgroundcolor", [1 1 1], "constraints", c);
+
+ // Border for the control parameters frame
+ b_f_controlParams = createBorderFont("", 18);
+ b_l_controlParams = createBorder("line", "navy", 2);
+ b_controlParams = createBorder("titled", b_l_controlParams, _("Control panel"), "center", "top", b_f_controlParams, "navy");
+
+ control_frame = uicontrol(u, ...
+ "style", "frame", ...
+ "backgroundcolor", [1 1 1], ...
+ "border", b_controlParams, ...
+ "layout", "gridbag", ...
+ "tag", "control_frame");
+
+ demo_viewCode("demo_custom.dem.sce");
+
+ fig_handle.color_map = jetcolormap(128);
+
+ // Frames creation [Control Panel]
+ // =========================================================================
+
+ // Explanatory text
+ // =========================================================================
+
+ my_exptext_string = "";
+
+ my_exptext_string = my_exptext_string + "<html>";
+
+ my_exptext_string = my_exptext_string + "<center>";
+ my_exptext_string = my_exptext_string + "<img src=""file:///"+SCI+"/modules/graphics/demos/cmplxfunc/warning.png"+""">";
+ my_exptext_string = my_exptext_string + "BE CAREFUL, NOTHING IS PROTECTED";
+ my_exptext_string = my_exptext_string + "</center>";
+
+ my_exptext_string = my_exptext_string + "<hr><br />";
+
+ my_exptext_string = my_exptext_string + " To draw your own complex function :";
+
+ my_exptext_string = my_exptext_string + "<div style=''text-align:justify; margin-top:5px; width:260;''>";
+
+ my_exptext_string = my_exptext_string + "1. define the function by a correct ";
+ my_exptext_string = my_exptext_string + "string where the complex var must ";
+ my_exptext_string = my_exptext_string + "be z. Also, as the function will ";
+ my_exptext_string = my_exptext_string + "be evaluated on a matrix, don''t forget ";
+ my_exptext_string = my_exptext_string + "the . to operate elementwise. Examples: ";
+
+ my_exptext_string = my_exptext_string + "</div>";
+
+
+ my_exptext_string = my_exptext_string + "<pre> z.^2 (z+1).*(z-1) (1)./(z+2)</pre>";
+ my_exptext_string = my_exptext_string + "<pre> sqrt(z) (z+%i).*(z-%i) 1+2*z+z.^2</pre>";
+
+ my_exptext_string = my_exptext_string + "<div style=''text-align:justify; margin-top:5px; width:260;''>";
+ my_exptext_string = my_exptext_string + "2. define the type of the domain: Square or Disk,";
+ my_exptext_string = my_exptext_string + "</div>";
+
+
+ my_exptext_string = my_exptext_string + "<div style=''text-align:justify; margin-top:5px; width:260;''>";
+ my_exptext_string = my_exptext_string + "3. define the ""radius"" R of the domain,"+ "<br />";
+ my_exptext_string = my_exptext_string + "</div>";
+
+
+ my_exptext_string = my_exptext_string + "<div style=''text-align:justify; margin-top:5px; width:260;''>";
+ my_exptext_string = my_exptext_string + "4. should your function have some kind of ";
+ my_exptext_string = my_exptext_string + "discontinuity on Ox or Oy => check ";
+ my_exptext_string = my_exptext_string + "Ox or Oy. Otherwise check No.";
+ my_exptext_string = my_exptext_string + "</div>";
+
+ my_exptext_string = my_exptext_string + "</html>";
+
+
+ // Explanatory text : frame
+
+ b_f_expTxt = createBorderFont("", 12);
+ b_l_expTxt = createBorder("line", "navy", 1);
+ b_expTxt = createBorder("titled", b_l_expTxt, "", "center", "top", b_f_expTxt, "navy");
+
+ // Border for the explanatory text frame
+ c = createConstraints("gridbag", [1 1 1 1], [1 1], "both", "upper");
+ my_exptext_frame = uicontrol( ...
+ "parent" , control_frame,...
+ "style" , "frame",...
+ "layout" , "gridbag", ...
+ "border" , b_expTxt, ...
+ "units" , "pixels",...
+ "background" , [1 1 1], ...
+ "constraint" , c, ...
+ "tag" , "my_exptext_frame" ...
+ );
+
+ // Explanatory text : actual text
+
+ c = createConstraints("gridbag", [1 1 1 1], [1 1], "both", "upper");
+ my_exptext_box = uicontrol( ...
+ "parent" , my_exptext_frame,...
+ "style" , "text",...
+ "units" , "pixels",...
+ "string" , my_exptext_string,...
+ "fontname" , defaultfont,...
+ "fontunits" , "points",...
+ "fontsize" , 9,...
+ "background" , [1 1 1], ...
+ "constraint" , c, ...
+ "tag" , "my_exptext_box" ...
+ );
+
+
+ // Function definition
+ // =========================================================================
+
+ // Function definition : frame
+
+ // Border for the function definition frame
+ b_f_funDef = createBorderFont("", 12);
+ b_l_funDef = createBorder("line", "navy", 1);
+ b_funDef = createBorder("titled", b_l_funDef, _("Function definition"), "center", "top", b_f_funDef, "navy");
+
+ c = createConstraints("gridbag", [1 2 1 1], [1 1], "both", "upper");
+ my_fundef_frame = uicontrol( ...
+ "parent" , control_frame,...
+ "style" , "frame",...
+ "layout" , "gridbag", ...
+ "border" , b_funDef, ...
+ "units" , "pixels",...
+ "fontname" , defaultfont,...
+ "fontunits" , "points",...
+ "fontsize" , 13,...
+ "fontweight" , "bold", ...
+ "background" , [1 1 1], ...
+ "constraints" , c, ...
+ "tag" , "my_fundef_frame" ...
+ );
+
+ // Function definition : Text "f(z) = "
+
+ c = createConstraints("gridbag", [1 1 1 1], [1/12 1], "both", "upper");
+ my_fundef_editbox = uicontrol( ...
+ "parent" , my_fundef_frame,...
+ "style" , "text",...
+ "string" , "f(z) = ", ...
+ "fontname" , defaultfont,...
+ "fontunits" , "points",...
+ "fontsize" , 11,...
+ "background" , [1 1 1], ...
+ "constraint" , c, ...
+ "tag" , "my_fundef_editbox");
+
+ // Function definition : Edit box
+
+ c = createConstraints("gridbag", [2 1 1 1], [12 1], "both", "upper");
+ my_fundef_editbox = uicontrol( ...
+ "parent" , my_fundef_frame,...
+ "style" , "edit",...
+ "fontname" , defaultfont,...
+ "fontunits" , "points",...
+ "fontsize" , 11,...
+ "string" , "(1)./((z+2).*(2-z))", ...
+ "callback" , "update_fundef()",...
+ "constraint" , c, ...
+ "tag" , "my_fundef_editbox");
+
+ // Function definition : message bar
+
+ c = createConstraints("gridbag", [1 2 2 1], [1 1], "both", "upper");
+ my_exptext_bar = uicontrol( ...
+ "parent" , my_fundef_frame,...
+ "style" , "text",...
+ "string" , " ", ...
+ "units" , "pixels",...
+ "fontname" , defaultfont,...
+ "fontunits" , "points",...
+ "fontsize" , 11,...
+ "background" , [1 1 1], ...
+ "constraint" , c, ...
+ "tag" , "my_funDef_bar" ...
+ );
+
+
+ // Domain type
+ // =========================================================================
+
+ // Domain type : frame
+
+ // Border for the domain type frame
+ b_f_domain = createBorderFont("", 12);
+ b_l_domain = createBorder("line", "navy", 1);
+ b_domain = createBorder("titled", b_l_domain, _("Domain type"), "center", "top", b_f_domain, "navy");
+
+ c = createConstraints("gridbag", [1 3 1 1], [1 1], "both", "upper");
+ my_dt_frame = uicontrol( ...
+ "parent" , control_frame,...
+ "style" , "frame",...
+ "layout" , "gridbag", ...
+ "border" , b_domain, ...
+ "units" , "pixels",...
+ "fontname" , defaultfont,...
+ "fontunits" , "points",...
+ "fontsize" , 13,...
+ "fontweight" , "bold", ...
+ "background" , [1 1 1], ...
+ "constraint" , c, ...
+ "tag" , "my_dt_frame" ...
+ );
+
+ // Domain type : square
+
+ c = createConstraints("gridbag", [1 1 1 1], [1 1], "both", "upper");
+ square_radio = uicontrol( ...
+ "parent" , my_dt_frame,...
+ "style" , "radiobutton",...
+ "string" , "Square",...
+ "fontname" , defaultfont,...
+ "fontunits" , "points",...
+ "fontsize" , 11,...
+ "value" , 0, ...
+ "background" , [1 1 1], ...
+ "callback" , "update_domain_type();",...
+ "constraints" , c, ...
+ "tag" , "square_radio");
+
+ // Domain type : Disk
+
+ c = createConstraints("gridbag", [2 1 1 1], [1 1], "both", "upper");
+ disk_radio = uicontrol( ...
+ "parent" , my_dt_frame,...
+ "style" , "radiobutton",...
+ "string" , "Disk",...
+ "fontname" , defaultfont,...
+ "fontunits" , "points",...
+ "fontsize" , 11,...
+ "value" , 1, ...
+ "background" , [1 1 1], ...
+ "callback" , "update_domain_type();",...
+ "constraints" , c, ...
+ "tag" , "disk_radio");
+
+
+ // Radius of the domain
+ // =========================================================================
+
+ // Radius of the domain : frame
+
+ // Border for the radius frame
+ b_f_radius = createBorderFont("", 12);
+ b_l_radius = createBorder("line", "navy", 1);
+ b_radius = createBorder("titled", b_l_radius, _("Radius of the domain"), "center", "top", b_f_radius, "navy");
+
+ c = createConstraints("gridbag", [1 4 1 1], [1 1], "both", "upper");
+ my_radius_frame = uicontrol( ...
+ "parent" , control_frame,...
+ "style" , "frame",...
+ "layout" , "gridbag", ...
+ "border" , b_radius, ...
+ "units" , "pixels",...
+ "fontname" , defaultfont,...
+ "fontunits" , "points",...
+ "fontsize" , 13,...
+ "fontweight" , "bold", ...
+ "background" , [1 1 1], ...
+ "constraint" , c, ...
+ "tag" , "my_radius_frame" ...
+ );
+
+ // Radius of the domain : Edit box
+
+ c = createConstraints("gridbag", [1 1 1 1], [1 1], "both", "upper");
+ my_radius_editbox = uicontrol( ...
+ "parent" , my_radius_frame,...
+ "style" , "edit",...
+ "fontname" , defaultfont,...
+ "fontunits" , "points",...
+ "fontsize" , 11,...
+ "string" , "1.9", ...
+ "callback" , "update_radius()",...
+ "constraint" , c, ...
+ "tag" , "my_radius_editbox");
+
+ // Radius of the domain : message bar
+
+ c = createConstraints("gridbag", [1 2 1 1], [1 1], "both", "upper");
+ my_exptext_bar = uicontrol( ...
+ "parent" , my_radius_frame,...
+ "style" , "text",...
+ "string" , " ", ...
+ "units" , "pixels",...
+ "fontname" , defaultfont,...
+ "fontunits" , "points",...
+ "fontsize" , 11,...
+ "background" , [1 1 1], ...
+ "constraint" , c, ...
+ "tag" , "my_radius_bar" ...
+ );
+
+
+ // Cut on axes
+ // =========================================================================
+
+ // Cut on axes : frame
+
+ // Border for the cut on axes frame
+ b_f_cut = createBorderFont("", 12);
+ b_l_cut = createBorder("line", "navy", 1);
+ b_cut = createBorder("titled", b_l_cut, _("Cut on axes"), "center", "top", b_f_cut, "navy");
+
+ c = createConstraints("gridbag", [1 5 1 1], [1 1], "both", "upper");
+ my_coa_frame = uicontrol( ...
+ "parent" , control_frame,...
+ "style" , "frame",...
+ "layout" , "gridbag", ...
+ "border" , b_cut, ...
+ "units" , "pixels",...
+ "fontname" , defaultfont,...
+ "fontunits" , "points",...
+ "fontsize" , 13,...
+ "fontweight" , "bold", ...
+ "background" , [1 1 1], ...
+ "constraint" , c, ...
+ "tag" , "my_coa_frame" ...
+ );
+
+ // Cut on axes : Ox
+
+ c = createConstraints("gridbag", [1 1 1 1], [1 1], "both", "upper");
+ ox_radio = uicontrol( ...
+ "parent" , my_coa_frame,...
+ "style" , "radiobutton",...
+ "string" , "Ox",...
+ "fontname" , defaultfont,...
+ "fontunits" , "points",...
+ "fontsize" , 11,...
+ "value" , 0, ...
+ "background" , [1 1 1], ...
+ "callback" , "update_cao();",...
+ "constraint" , c, ...
+ "tag" , "ox_radio");
+
+ // Cut on axes : Oy
+
+ c = createConstraints("gridbag", [2 1 1 1], [1 1], "both", "upper");
+ oy_radio = uicontrol( ...
+ "parent" , my_coa_frame,...
+ "style" , "radiobutton",...
+ "string" , "Oy",...
+ "fontname" , defaultfont,...
+ "fontunits" , "points",...
+ "fontsize" , 11,...
+ "value" , 0, ...
+ "background" , [1 1 1], ...
+ "callback" , "update_cao();",...
+ "constraint" , c, ...
+ "tag" , "oy_radio");
+
+ // Cut on axes : No
+
+ c = createConstraints("gridbag", [3 1 1 1], [1 1], "both", "upper");
+ no_radio = uicontrol( ...
+ "parent" , my_coa_frame,...
+ "style" , "radiobutton",...
+ "string" , "No",...
+ "fontname" , defaultfont,...
+ "fontunits" , "points",...
+ "fontsize" , 11,...
+ "value" , 1, ...
+ "background" , [1 1 1], ...
+ "callback" , "update_cao();",...
+ "constraint" , c, ...
+ "tag" , "no_radio");
+
+ // Default Values
+ // =========================================================================
+
+ global my_fundef_val;
+ global my_dt_val;
+ global my_radius;
+ global my_typeCut;
+ global my_e;
+
+
+ my_fundef_val = "(1)./((z+2).*(2-z))";
+ my_dt_val = "Disk";
+ my_radius = 1.9;
+ my_typeCut = "No";
+
+ my_e = 0.001;
+ theta = -110;
+ alpha = 75;
+
+ deff("Z=f(z)","Z="+my_fundef_val);
+
+ PlotCmplxFunc(my_radius,my_e,my_dt_val,my_typeCut,[40 20],"f",theta,alpha,[0;0]);
+ fig_handle.visible = "on";
+
+endfunction
+
+function update_fundef()
+
+ global my_fundef_val;
+ global my_dt_val;
+ global my_radius;
+ global my_typeCut;
+ global my_e;
+
+ my_fundef_val_tmp = get(gcbo,"string");
+
+ if strchr(my_fundef_val_tmp, "z") == "" then
+ updateStatusBar("my_funDef_bar", _("Function should contain ""z"""), [1 0 0]);
+ return
+ end
+
+ try // Try f(z) on a simple matrix
+ ieeeMode = ieee();
+ ieee(2);
+ execstr(strsubst(my_fundef_val_tmp, "z", "[1 2 3; 1 2 3]"));
+ ieee(ieeeMode);
+ catch
+ updateStatusBar("my_funDef_bar", _("Wrong definition of f(z)"), [1 0 0]);
+ return
+ end
+
+ my_fundef_val = my_fundef_val_tmp;
+
+ // Delete the old plots
+
+ demo_fig = gcf();
+ demo_fig.immediate_drawing = "off";
+
+ a = gca(); delete(a);
+ a = gca(); delete(a);
+ a = gca(); delete(a);
+
+ theta = -110;
+ alpha = 75;
+
+ deff("Z=f(z)","Z="+my_fundef_val);
+
+ if my_dt_val == "Square" then
+ PlotCmplxFunc(my_radius,my_e,my_dt_val,my_typeCut,41,"f",theta,alpha,[0;0]);
+ elseif my_dt_val == "Disk" then
+ PlotCmplxFunc(my_radius,my_e,my_dt_val,my_typeCut,[40 20],"f",theta,alpha,[0;0]);
+ end
+
+ demo_fig.immediate_drawing = "on";
+
+endfunction
+
+function update_domain_type()
+
+ global my_fundef_val;
+ global my_dt_val;
+ global my_radius;
+ global my_typeCut;
+ global my_e;
+
+ // Update the radio elements
+ set(findobj("tag", "square_radio") , "value", 0);
+ set(findobj("tag", "disk_radio") , "value", 0);
+ set(gcbo, "value", 1);
+
+ // Delete the old plots
+
+ demo_fig = gcf();
+ demo_fig.immediate_drawing = "off";
+
+ a = gca(); delete(a);
+ a = gca(); delete(a);
+ a = gca(); delete(a);
+
+ theta = -110;
+ alpha = 75;
+
+ deff("Z=f(z)","Z="+my_fundef_val);
+
+ if get(gcbo, "tag") == "square_radio" then
+ my_dt_val = "Square";
+ elseif get(gcbo, "tag") == "disk_radio" then
+ my_dt_val = "Disk";
+ end
+
+ if my_dt_val == "Square" then
+ PlotCmplxFunc(my_radius,my_e,my_dt_val,my_typeCut,41,"f",theta,alpha,[0;0]);
+ elseif my_dt_val == "Disk" then
+ PlotCmplxFunc(my_radius,my_e,my_dt_val,my_typeCut,[40 20],"f",theta,alpha,[0;0]);
+ end
+
+ demo_fig.immediate_drawing = "on";
+
+endfunction
+
+function update_radius()
+
+ global my_fundef_val;
+ global my_dt_val;
+ global my_radius;
+ global my_typeCut;
+ global my_e;
+
+ try
+ my_radius_tmp = evstr(get(gcbo,"string"));
+ catch
+ updateStatusBar("my_radius_bar", _("Radius should be real and finite"), [1 0 0]);
+ return
+ end
+
+ if ~isscalar(my_radius_tmp) | and(type(my_radius_tmp) <> [1 8]) | ~isreal(my_radius_tmp) | isinf(my_radius_tmp) then
+ updateStatusBar(_("Radius should be real and finite"), [1 0 0]);
+ return
+ else
+ my_radius = my_radius_tmp;
+ end
+
+ // Delete the old plots
+
+ demo_fig = gcf();
+ demo_fig.immediate_drawing = "off";
+
+ a = gca(); delete(a);
+ a = gca(); delete(a);
+ a = gca(); delete(a);
+
+ theta = -110;
+ alpha = 75;
+
+ deff("Z=f(z)","Z="+my_fundef_val);
+
+ if my_dt_val == "Square" then
+ PlotCmplxFunc(my_radius,my_e,my_dt_val,my_typeCut,41,"f",theta,alpha,[0;0]);
+ elseif my_dt_val == "Disk" then
+ PlotCmplxFunc(my_radius,my_e,my_dt_val,my_typeCut,[40 20],"f",theta,alpha,[0;0]);
+ end
+
+ demo_fig.immediate_drawing = "on";
+
+endfunction
+
+function update_cao()
+
+ global my_fundef_val;
+ global my_dt_val;
+ global my_radius;
+ global my_typeCut;
+ global my_e;
+
+ // Update the radio elements
+ set(findobj("tag", "ox_radio") , "value", 0);
+ set(findobj("tag", "oy_radio") , "value", 0);
+ set(findobj("tag", "no_radio") , "value", 0);
+ set(gcbo, "value", 1);
+
+ // Delete the old plots
+
+ demo_fig = gcf();
+ demo_fig.immediate_drawing = "off";
+
+ a = gca(); delete(a);
+ a = gca(); delete(a);
+ a = gca(); delete(a);
+
+ theta = -110;
+ alpha = 75;
+
+ deff("Z=f(z)","Z="+my_fundef_val);
+
+ if get(gcbo, "tag") == "ox_radio" then
+ my_typeCut = "Ox";
+ elseif get(gcbo, "tag") == "oy_radio" then
+ my_typeCut = "Oy";
+ elseif get(gcbo, "tag") == "no_radio" then
+ my_typeCut = "No";
+ end
+
+ if my_dt_val == "Square" then
+ PlotCmplxFunc(my_radius,my_e,my_dt_val,my_typeCut,41,"f",theta,alpha,[0;0]);
+ elseif my_dt_val == "Disk" then
+ PlotCmplxFunc(my_radius,my_e,my_dt_val,my_typeCut,[40 20],"f",theta,alpha,[0;0]);
+ end
+
+ demo_fig.immediate_drawing = "on";
+
+endfunction
+
+function []=PlotCmplxFunc(R,e,TypeDomain,TypeCut,n,StrFunc,theta,alpha,DomReal)
+
+ // A function to draw on a square or a disk a complex function
+ // with branch(es) cut(s) on Ox or Oy
+ //
+ // TypeDomain : "Square" or "Disk"
+ // TypeCut : "Ox" or "Oy"
+ // R : length of half a side of the square or radius of the disk
+ // e : thin layer to avoid the branch(es) cut(s)
+ // n : a scalar (for Square) or a 2-vector = [ntheta, nr]
+ // (for Disk) for discretization
+ // StrFunc : the string which names the complex function (this is
+ // because primitive don't pass as function argument)
+ // theta,alpha : usual parameters for plot3d
+ // DomReal : interval for which the real restriction is drawn
+
+ // computes the facets
+
+ [xr,yr,zr,xi,yi,zi] = CmplxFacets(R,e,TypeDomain,TypeCut,n,StrFunc);
+
+ // draw
+ // ============================================
+
+ // Title
+ // ============================================
+
+ my_title_axes = newaxes();
+ my_title_axes.axes_bounds = [1/3,0,2/3,1];
+
+ // make axes transparent
+ my_title_axes.filled = "off";
+
+ Rs = string(R);
+
+ if TypeDomain == "Square" then
+ end_title = " function on [-"+Rs+","+Rs+"]x[-"+Rs+","+Rs+"]"
+ else
+ end_title = " function on D(0,R="+Rs+")"
+ end
+
+ if StrFunc == "f" then
+ the_title = "Your custom (named f) complex" + end_title;
+ else
+ the_title = "The complex " + StrFunc + end_title;
+ end
+
+ xtitle(the_title);
+
+ my_title_axes.title.text = the_title;
+ my_title_axes.title.font_size = 3;
+ my_title_axes.margins = [ 0.15 0.08 0.08 0.08 ]
+
+ // plot Im(z)
+ // ============================================
+
+ subplot(211)
+ plot3d(xi,yi,zi,theta,alpha,"Re(z)@Im(z)@",[2 6 4]);
+
+ my_IM_axes = gca();
+ my_IM_axes.axes_bounds = [0.16, 0.05, 1, 0.5];
+ my_IM_plot = my_IM_axes.children;
+ my_IM_plot.color_flag = 1;
+
+ xtitle("Im("+StrFunc+"(z))");
+ my_IM_axes.margins = [0.2, 0.2, 0.2, 0.2];
+ my_IM_axes.cube_scaling = "on";
+
+ // plot Re(z) + the real restriction
+ // ============================================
+
+ subplot(212)
+ plot3d(xr,yr,zr,theta,alpha,"Re(z)@Im(z)@",[2 6 4]);
+
+ my_RE_axes = gca();
+ my_RE_axes.axes_bounds = [0.16, 0.5, 1, 0.5];
+ my_RE_plot = my_RE_axes.children;
+ my_RE_plot.color_flag = 1;
+
+ xtitle("Re("+StrFunc+"(z))");
+ my_RE_axes.margins = [0.2, 0.2, 0.2, 0.2];
+ my_RE_axes.cube_scaling = "on";
+
+ // real function in yellow
+ // ============================================
+
+ if DomReal(2) > DomReal(1) then
+ xstring(0.1,-0.15," In yellow : the real "+StrFunc+" function")
+ end
+
+ if DomReal(2) > DomReal(1) then
+ xx = linspace(DomReal(1),DomReal(2),40)';
+ yy = zeros(xx);
+ zz = evstr(StrFunc+"(xx)");
+ param3d1(xx,yy,list(zz,32),theta,alpha,flag=[0,0]);
+ yellow_line = get("hdl");
+ yellow_line.thickness = 3;
+ end
+
+endfunction
+
+function [xr,yr,zr,xi,yi,zi] = CmplxFacets(R,e,TypeDomain,TypeCut,n,StrFunc)
+
+ // A function to compute the facets for drawing a complex function
+ // on a square or a disk with branch(es) cut(s) on Ox or Oy
+ //
+ // TypeDomain : "Square" or "Disk"
+ // TypeCut : "Ox" or "Oy"
+ // R : length of half a side of the square or radius of the disk
+ // e : thin layer to avoid the branch(es) cut(s)
+ // n : a scalar (for Square) or a 2-vector = [ntheta, nr]
+ // (for Disk) for discretization
+ // StrFunc : the string which names the complex function (this is
+ // because primitive don't pass as function argument)
+
+ if TypeDomain == "Square" then
+ if TypeCut == "Ox" then
+ x1 = linspace(-R, R, n);
+ y1 = linspace( e, R, int(n/2));
+ else // for TypeCut = "Oy" ...
+ x1 = linspace( e, R, int(n/2));
+ y1 = linspace(-R, R, n);
+ end
+ X1 = ones(y1')*x1 ; Y1 = y1'*ones(x1);
+
+ else // for TypeDomain = "Disk"
+ r = linspace(0,R, n(2));
+ if TypeCut == "Ox" then
+ theta = linspace(0,%pi,n(1))';
+ X1 = cos(theta)*r;
+ Y1 = e + sin(theta)*r;
+ else // for TypeCut = "Oy"
+ theta = linspace(-%pi/2,%pi/2,n(1))';
+ X1 = e + cos(theta)*r;
+ Y1 = sin(theta)*r;
+ end
+ end
+
+ X2 = -X1 ; Y2 = -Y1;
+ Z1 = evstr(StrFunc+"(X1 + %i*Y1)");
+ Z2 = evstr(StrFunc+"(X2 + %i*Y2)");
+ [xr1,yr1,zr1] = nf3d(X1,Y1,real(Z1));
+ [xr2,yr2,zr2] = nf3d(X2,Y2,real(Z2));
+ xr = [xr1 xr2]; yr = [yr1 yr2]; zr = [zr1 zr2];
+ [xi1,yi1,zi1] = nf3d(X1,Y1,imag(Z1));
+ [xi2,yi2,zi2] = nf3d(X2,Y2,imag(Z2));
+ xi = [xi1 xi2]; yi = [yi1 yi2]; zi = [zi1 zi2];
+
+endfunction
+
+// =============================================================================
+// updateStatusBar
+// + Update the string in the text frame
+// =============================================================================
+function updateStatusBar(tag,msg, msg_color)
+ time_active = 2; //Time the message is active in s
+
+ if argn(2) == 0 then
+ set(tag, "String", " ");
+ return
+ end
+
+ h = gcf();
+ set(tag, "Foregroundcolor", msg_color, "String", msg);
+
+ delta_time = 0;
+ timer()
+ while delta_time < time_active
+ delta_time = delta_time + timer();
+ end
+
+ if is_handle_valid(h)
+ updateStatusBar();
+ end
+endfunction
+
+funcprot(1);
+
+demo_custom();
+
+clear demo_custom();
diff --git a/modules/graphics/demos/cmplxfunc/demo_exp.dem.sce b/modules/graphics/demos/cmplxfunc/demo_exp.dem.sce
new file mode 100755
index 000000000..ea58d90a7
--- /dev/null
+++ b/modules/graphics/demos/cmplxfunc/demo_exp.dem.sce
@@ -0,0 +1,27 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+// =============================================================================
+// exp
+// =============================================================================
+
+function demo_exp()
+
+ exec("SCI/modules/graphics/demos/cmplxfunc/MacCmplx.sci", -1);
+
+ R = 2;
+ theta = -130;
+ alpha = 73;
+
+ my_handle = scf(100001);
+ clf(my_handle,"reset");
+
+ PlotCmplxFunc(R,0,"Disk","Ox",[40 20],"exp",theta,alpha,[-R,R]);
+ demo_viewCode("demo_exp.dem.sce");
+
+endfunction
+
+demo_exp()
+clear demo_exp;
diff --git a/modules/graphics/demos/cmplxfunc/demo_log.dem.sce b/modules/graphics/demos/cmplxfunc/demo_log.dem.sce
new file mode 100755
index 000000000..cadc42e59
--- /dev/null
+++ b/modules/graphics/demos/cmplxfunc/demo_log.dem.sce
@@ -0,0 +1,28 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2005-2008 - INRIA - Pierre MARECHAL <pierre.marechal@inria.fr>
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+// =============================================================================
+// log
+// =============================================================================
+
+function demo_log()
+
+ exec("SCI/modules/graphics/demos/cmplxfunc/MacCmplx.sci", -1);
+
+ R = 4;
+ e = 0.001;
+ theta = 30;
+ alpha = 60;
+
+ my_handle = scf(100001);
+ clf(my_handle,"reset");
+
+ PlotCmplxFunc(R,e,"Disk","Ox",[40 20],"log",theta,alpha,[e,R]);
+ demo_viewCode("demo_log.dem.sce");
+
+endfunction
+
+demo_log()
+clear demo_log;
diff --git a/modules/graphics/demos/cmplxfunc/demo_sin.dem.sce b/modules/graphics/demos/cmplxfunc/demo_sin.dem.sce
new file mode 100755
index 000000000..3bbdbe313
--- /dev/null
+++ b/modules/graphics/demos/cmplxfunc/demo_sin.dem.sce
@@ -0,0 +1,28 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+// =============================================================================
+// sin
+// =============================================================================
+
+function demo_sin()
+
+ exec("SCI/modules/graphics/demos/cmplxfunc/MacCmplx.sci", -1);
+
+ R = %pi;
+ theta = -130;
+ alpha = 73;
+ e = 0.001;
+
+ my_handle = scf(100001);
+ clf(my_handle,"reset");
+
+ PlotCmplxFunc(R,e,"Disk","Ox",[40 20],"sin",theta,alpha,[-R,R]);
+ demo_viewCode("demo_sin.dem.sce");
+
+endfunction
+
+demo_sin()
+clear demo_sin;
diff --git a/modules/graphics/demos/cmplxfunc/demo_sinh.dem.sce b/modules/graphics/demos/cmplxfunc/demo_sinh.dem.sce
new file mode 100755
index 000000000..754790fb5
--- /dev/null
+++ b/modules/graphics/demos/cmplxfunc/demo_sinh.dem.sce
@@ -0,0 +1,28 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+// =============================================================================
+// sinh
+// =============================================================================
+
+function demo_sinh()
+
+ exec("SCI/modules/graphics/demos/cmplxfunc/MacCmplx.sci", -1);
+
+ R = %pi;
+ e = 0;
+ theta = -148;
+ alpha = 60;
+
+ my_handle = scf(100001);
+ clf(my_handle,"reset");
+
+ PlotCmplxFunc(R,0,"Disk","Ox",[40 20],"sinh",theta,alpha,[-R,R]);
+ demo_viewCode("demo_sinh.dem.sce");
+
+endfunction
+
+demo_sinh()
+clear demo_sinh;
diff --git a/modules/graphics/demos/cmplxfunc/demo_tan.dem.sce b/modules/graphics/demos/cmplxfunc/demo_tan.dem.sce
new file mode 100755
index 000000000..d3bb7ffa1
--- /dev/null
+++ b/modules/graphics/demos/cmplxfunc/demo_tan.dem.sce
@@ -0,0 +1,26 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+// =============================================================================
+// tan
+// =============================================================================
+
+function demo_tan()
+
+ exec("SCI/modules/graphics/demos/cmplxfunc/MacCmplx.sci", -1);
+ R = %pi/2-0.15;
+ theta = -130;
+ alpha = 73;
+
+ my_handle = scf(100001);
+ clf(my_handle,"reset");
+
+ PlotCmplxFunc(R,0,"Square","Ox",41,"tan",theta,alpha,[-R,R]);
+ demo_viewCode("demo_tan.dem.sce");
+
+endfunction
+
+demo_tan()
+clear demo_tan;
diff --git a/modules/graphics/demos/cmplxfunc/demo_tanh.dem.sce b/modules/graphics/demos/cmplxfunc/demo_tanh.dem.sce
new file mode 100755
index 000000000..403f0c89f
--- /dev/null
+++ b/modules/graphics/demos/cmplxfunc/demo_tanh.dem.sce
@@ -0,0 +1,28 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+// =============================================================================
+// tanh
+// =============================================================================
+
+function demo_tanh()
+
+ exec("SCI/modules/graphics/demos/cmplxfunc/MacCmplx.sci", -1);
+
+ R = %pi/2-0.2;
+ e = 0;
+ theta = -130;
+ alpha = 73;
+
+ my_handle = scf(100001);
+ clf(my_handle,"reset");
+
+ PlotCmplxFunc(R,e,"Square","Ox",41,"tanh",theta,alpha,[-R,R]);
+ demo_viewCode("demo_tanh.dem.sce");
+
+endfunction
+
+demo_tanh();
+clear demo_tanh;
diff --git a/modules/graphics/demos/cmplxfunc/warning.png b/modules/graphics/demos/cmplxfunc/warning.png
new file mode 100755
index 000000000..d140d247e
--- /dev/null
+++ b/modules/graphics/demos/cmplxfunc/warning.png
Binary files differ