Mercurial > hg > octave-nkf
comparison scripts/geometry/voronoin.m @ 11469:c776f063fefe
Overhaul m-script files to use common variable name between code and documentation.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 09 Jan 2011 12:41:21 -0800 |
parents | be55736a0783 |
children | fd0a3ac60b0e |
comparison
equal
deleted
inserted
replaced
11468:e1edf0ba3bcb | 11469:c776f063fefe |
---|---|
17 ## <http://www.gnu.org/licenses/>. | 17 ## <http://www.gnu.org/licenses/>. |
18 | 18 |
19 ## -*- texinfo -*- | 19 ## -*- texinfo -*- |
20 ## @deftypefn {Function File} {[@var{C}, @var{F}] =} voronoin (@var{pts}) | 20 ## @deftypefn {Function File} {[@var{C}, @var{F}] =} voronoin (@var{pts}) |
21 ## @deftypefnx {Function File} {[@var{C}, @var{F}] =} voronoin (@var{pts}, @var{options}) | 21 ## @deftypefnx {Function File} {[@var{C}, @var{F}] =} voronoin (@var{pts}, @var{options}) |
22 ## computes n- dimensional Voronoi facets. The input matrix @var{pts} | 22 ## Compute N-dimensional Voronoi facets. The input matrix @var{pts} |
23 ## of size [n, dim] contains n points of dimension dim. | 23 ## of size [n, dim] contains n points of dimension dim. |
24 ## @var{C} contains the points of the Voronoi facets. The list @var{F} | 24 ## @var{C} contains the points of the Voronoi facets. The list @var{F} |
25 ## contains for each facet the indices of the Voronoi points. | 25 ## contains for each facet the indices of the Voronoi points. |
26 ## | 26 ## |
27 ## A second optional argument, which must be a string, contains extra options | 27 ## A second optional argument, which must be a string, contains extra options |
35 | 35 |
36 ## 2003-12-14 Rafael Laboissiere <rafael@laboissiere.net> | 36 ## 2003-12-14 Rafael Laboissiere <rafael@laboissiere.net> |
37 ## Added optional second argument to pass options to the underlying | 37 ## Added optional second argument to pass options to the underlying |
38 ## qhull command | 38 ## qhull command |
39 | 39 |
40 function [C, F] = voronoin (pts, opt) | 40 function [C, F] = voronoin (pts, options) |
41 | 41 |
42 if (nargin != 1 && nargin != 2) | 42 if (nargin != 1 && nargin != 2) |
43 print_usage (); | 43 print_usage (); |
44 endif | 44 endif |
45 | 45 |
46 [np, dims] = size (pts); | 46 [np, dims] = size (pts); |
47 if (np > dims) | 47 if (np > dims) |
48 if (nargin == 1) | 48 if (nargin == 1) |
49 [C, F, infi] = __voronoi__ (pts); | 49 [C, F, infi] = __voronoi__ (pts); |
50 elseif ischar(opt) | 50 elseif (ischar (options)) |
51 [C, F, infi] = __voronoi__ (pts, opt); | 51 [C, F, infi] = __voronoi__ (pts, options); |
52 else | 52 else |
53 error ("voronoin: second argument must be a string"); | 53 error ("voronoin: second argument must be a string"); |
54 endif | 54 endif |
55 | 55 |
56 else | 56 else |