1########################################################################
2##
3## Copyright (C) 2007-2021 The Octave Project Developers
4##
5## See the file COPYRIGHT.md in the top-level directory of this
6## distribution or <https://octave.org/copyright/>.
7##
8## This file is part of Octave.
9##
10## Octave is free software: you can redistribute it and/or modify it
11## under the terms of the GNU General Public License as published by
12## the Free Software Foundation, either version 3 of the License, or
13## (at your option) any later version.
14##
15## Octave is distributed in the hope that it will be useful, but
16## WITHOUT ANY WARRANTY; without even the implied warranty of
17## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18## GNU General Public License for more details.
19##
20## You should have received a copy of the GNU General Public License
21## along with Octave; see the file COPYING.  If not, see
22## <https://www.gnu.org/licenses/>.
23##
24########################################################################
25
26## -*- texinfo -*-
27## @deftypefn  {} {} ezsurfc (@var{f})
28## @deftypefnx {} {} ezsurfc (@var{fx}, @var{fy}, @var{fz})
29## @deftypefnx {} {} ezsurfc (@dots{}, @var{dom})
30## @deftypefnx {} {} ezsurfc (@dots{}, @var{n})
31## @deftypefnx {} {} ezsurfc (@dots{}, "circ")
32## @deftypefnx {} {} ezsurfc (@var{hax}, @dots{})
33## @deftypefnx {} {@var{h} =} ezsurfc (@dots{})
34##
35## Plot the surface and contour lines defined by a function.
36##
37## @var{f} is a string, inline function, or function handle with two arguments
38## defining the function.  By default the plot is over the meshed domain
39## @code{-2*pi <= @var{x} | @var{y} <= 2*pi} with 60 points in each dimension.
40##
41## If three functions are passed, then plot the parametrically defined
42## function @code{[@var{fx}(@var{s}, @var{t}), @var{fy}(@var{s}, @var{t}),
43## @var{fz}(@var{s}, @var{t})]}.
44##
45## If @var{dom} is a two element vector, it represents the minimum and maximum
46## values of both @var{x} and @var{y}.  If @var{dom} is a four element vector,
47## then the minimum and maximum values are @code{[xmin xmax ymin ymax]}.
48##
49## @var{n} is a scalar defining the number of points to use in each dimension.
50##
51## If the argument @qcode{"circ"} is given, then the function is plotted over
52## a disk centered on the middle of the domain @var{dom}.
53##
54## If the first argument @var{hax} is an axes handle, then plot into this axes,
55## rather than the current axes returned by @code{gca}.
56##
57## The optional return value @var{h} is a 2-element vector with a graphics
58## handle for the created surface plot and a second handle for the created
59## contour plot.
60##
61## Example:
62##
63## @example
64## @group
65## f = @@(x,y) sqrt (abs (x .* y)) ./ (1 + x.^2 + y.^2);
66## ezsurfc (f, [-3, 3]);
67## @end group
68## @end example
69##
70## @seealso{surfc, ezsurf, ezplot, ezmesh, ezmeshc, shading}
71## @end deftypefn
72
73function h = ezsurfc (varargin)
74
75  [htmp, needusage] = __ezplot__ ("surfc", varargin{:});
76
77  if (needusage)
78    print_usage ();
79  endif
80
81  if (nargout > 0)
82    h = htmp;
83  endif
84
85endfunction
86
87
88%!demo
89%! clf;
90%! colormap ("default");
91%! f = @(x,y) sqrt (abs (x .* y)) ./ (1 + x.^2 + y.^2);
92%! ezsurfc (f, [-3, 3]);
93