Functions | |
endif | if (isvector(x)&&isvector(y)&&length(x)==length(y)) if(nargin |
elseif (ischar(opt)||iscellstr(opt)) tri | |
else | error ("delaunay: third argument must be a string") |
endif else | error ("delaunay: first two input arguments must be vectors of same size") |
endif | if (nargout==0) x |
x (tri(:, 2)) | |
x (tri(:, 3)) | |
x (tri(:, 1))] | |
y (tri(:, 2)) | |
y (tri(:, 3)) | |
y (tri(:, 1))] | |
plot (X, Y, 'b', x, y, 'r *') | |
!assert (sortrows(sort(delaunay(x, y), 2)),[1, 2, 5;1, 4, 5;2, 3, 5;3, 4, 5])%!demo%!rand('state' | |
x (T(:, 2)) | |
x (T(:, 3)) | |
x (T(:, 1))] | |
y (T(:, 2)) | |
y (T(:, 3)) | |
y (T(:, 1))] | |
!axis ([0, 1, 0, 1]) | |
!plot (X, Y,'b', x, y,'r *') | |
Variables | |
function | ret |
y = y(:).' | |
X = [x(tri(:,1)) | |
Y = [y(tri(:,1)) | |
endif endfunction!testif HAVE_QHULL | !x = [-1, 0, 1, 0, 0] |
!y = [0, 1, 0, -1, 0] | |
!T = delaunay(x,y) | |
!X = [ x(T(:,1)) | |
!Y = [ y(T(:,1)) |
!assert | ( | sortrows(sort(delaunay(x, y), 2)) | ) |
!axis | ( | ) |
!plot | ( | X | , | |
Y | , | |||
'b' | , | |||
x | , | |||
y | , | |||
'r *' | ||||
) |
elseif | ( | ischar(opt)||iscellstr(opt) | ) |
endif if | ( | nargout | = =0 |
) |
endif if | ( | isvector(x)&&isvector(y)&&length(x) | = =length(y) |
) |
plot | ( | X | , | |
Y | , | |||
'b' | , | |||
x | , | |||
y | , | |||
'r *' | ||||
) |
x | ( | T(:, 1) | ) |
x | ( | T(:, 3) | ) |
x | ( | T(:, 2) | ) |
x | ( | tri(:, 1) | ) |
x | ( | tri(:, 3) | ) |
x | ( | tri(:, 2) | ) |
y | ( | T(:, 1) | ) |
y | ( | T(:, 3) | ) |
y | ( | T(:, 2) | ) |
y | ( | tri(:, 1) | ) |
y | ( | tri(:, 3) | ) |
y | ( | tri(:, 2) | ) |
!T = delaunay(x,y) |
!X = [ x(T(:,1)) |
!x = [-1, 0, 1, 0, 0] |
!Y = [ y(T(:,1)) |
!y = [0, 1, 0, -1, 0] |
X = [x(tri(:,1)) |
Y = [y(tri(:,1)) |
y = y(:).' |